SyncDownloadAndImport
Structure
SyncDownloadAndImport(sSyncMapName, sService, sFolder, sToDirectory, sCompanyMap, sSQLUpdateAfterImport, dtDateTime, bLab, bAllowAuth, bDeleteCloudAfterImport, bDeleteLocalAfterImport)
Parameters
| Parameter | Type | Description
| sSyncMapName | String | Name of the Sync Map to be used - this should be an export-related sync mapsService | String | name of the Cloud service, should be either BOX or DROPBOXsFolder | String | Cloud folder that holds the sync zips to be downloaded/importedsToDirectory | String | Local directory that should be used to hold sync zips after downloadsCompanyMap | String | Company Map to be applied, use format of Company=MappedCompany with multiple items delimited by semicolons.sSQLUpdateAfterImport | String | SQL that should be applied to each equipment record after import. SQL should be in a format like example below (begins with 'UPDATE GAGES SET' and omits 'WHERE' - which will be auto-added depending upon asset being imported):
UPDATE GAGES SET MYFIELD='MY VAL'dtDateTime | Date/Time | Date/Time filter for potentially excluding files in the Cloud directory from download/importbLab | Boolean | True if 'Action Performed By' is 'Lab/Central'. False if 'Action Performed By' is 'Customer/RemotebAllowAuth | Boolean | If True then Cloud credentials can be prompted, if neededbDeleteCloudAfterImport | Boolean | If True then file in Cloud directory is deleted after importbDeleteLocalAfterImport | Boolean | If True then local file is deleted after import |
Return Value
String
Description
This function is related to Sync Maps as setup within IndySoft DataSync - Options. This function downloads and imports one/more import files based upon a sync map, exceptions to various criteria allowed.
Example
sService = "DROPBOX"
sFolder = "100003"
sToDirectory = "C:\Temp\Downloaded" & sFolder
sCompanyMap = "ABC COMPANY=12345;CDE COMPANY=545A781"
sSQLUpdateAfterImport = "UPDATE GAGES SET STATUS3 = '0'"
dtDateTime = (Now - 20)
bLab = False
bAllowAuth = True
bDeleteCloudAfterImport = False
bDeleteLocalAfterImport = False
sResult = SyncDownloadAndImport(sService, sFolder, sToDirectory, sCompanyMap,
sSQLUpdateAfterImport, dtDateTime, bLab, bAllowAuth, bDeleteCloudAfterImport, bDeleteLocalAfterImport)
DebugLog(sResult)
SendEMail("notreal@notgmail.com", "", "", "SyncDownloadAndImport Results", "", "SYNCMAP", sResult, False, False)
Application Compatibility
IndySoft Calibration Management, IndySoft Commercial Lab Management, IndySoft Tool Management |