Saltar al contenido principal

SyncExportAndUpload

Structure

SyncExportAndUpload(sSyncMapName, sEquipFilter, sService, sFolder, sLocalArchiveFolder, bLab, bOverwrite, bAllowAuth)

Parameters

| Parameter | Type | Description
| sSyncMapName | String | Name of the Sync Map to be used - this should be an export-related sync mapsEquipFilter | String | SQL for the filter of assets that should be exported. SQL should be in the format as in example below (begins with 'FROM GAGES WHERE '):

FROM GAGES WHERE COMPANY = 'ABC COMPANY'sService | String | name of the Cloud service, should be either BOX or DROPBOXsFolder | String | Cloud folder where the sync zips should be uploadedsLocalArchiveFolder | | Name of local archive folder (optional)bLab | Boolean | True if 'Action Performed By' is 'Lab/Central'. False if 'Action Performed By' is 'Customer/RemotebOverwrite | Boolean | If True then the Cloud file can be overwritten if exact match already existsbAllowAuth | Boolean | If True then Cloud credentials can be prompted, if needed |

Return Value

String

Description

This function is related to Sync Maps as setup within IndySoft DataSync - Options. This function exports a group of assets and uploads to cloud based upon a sync map, exceptions to various criteria allowed.

Example

sCompany = "100003"

if tdDoSQLRecords(1, "SELECT VARIABLE_DATE FROM COMPANY_VARS WHERE COMPANY = '" & sCompany & "' AND VARIABLE_NAME = 'LAST EXPORT DATE'") then

dtCompanyLastExport = tdFieldByNameAsDateTime(1, "VARIABLE_DATE")

Else

dtCompanyLastExport = 0

RunSQL("INSERT INTO COMPANY_VARS (COMPANY, VARIABLE_NAME) VALUES ('" & sCompany & "', 'LAST EXPORT DATE')")

End If

sSyncMapName = "TEST1"

sEquipFilter = "FROM GAGES WHERE COMPANY = '" & sCompany & "' AND LAST_MODIFIED_DATE >= '" & FormatDateTimeForSQL(dtCompanyLastExport) & "'"

sService = "DROPBOX"

sFolder = sCompany

sLocalArchiveFolder = "C:\Temp\Uploaded" & sCompany

bLab = True

bOverwrite = True

bAllowAuth = True

sResult = SyncExportAndUpload(sSyncMapName, sEquipFilter, sService, sFolder,

sLocalArchiveFolder, bLab, bOverwrite, bAllowAuth)

DebugLog(sResult)

SendEMail("notreal@notgmail.com", "", "", "SyncExportAndUpload Results", "", "SYNCMAP", sResult, False, False)

Application Compatibility

IndySoft Calibration Management, IndySoft Commercial Lab Management, IndySoft Tool Management |