Zum Hauptinhalt springen

ExportAsset

Structure

ExportAsset(sCompany, sID, sFileName, sEventFilter: Text): Text

Type

Function

Description

This function exports the ID specified in the sCompany and sID parameters to the IndySoft temp directory using the file name as specified in the sFileName parameter. This sFileName parameter should only contain the filename, NOT the full directory path (since the export will always export to IndySoft temp directory only). After export the temp file can be moved with the CopyLocalFile procedure if needed, or uploaded using UploadToDropbox, etc. The function will return either True or False, based on the success of the export. Use the optional sEventFilter parameter to specify a subset of events that should be exported. If this parameter is empty then all events for the asset will be exported. If the export is successful the function will return 'SUCCESS', otherwise the error condition will be returned.

Parameters: 4

sCompany = Company that owns the asset to be exported

sID = the ID to be exported

sFileName = the name of export file (NOT directory). Adding a file extension is not necessary (extension is ignored) - since the export file will always be a .zip. If this parameter is left blank then a file name will automatically be created in the format of Company-ID.zip.

sEventFilter = optional event filter for exporting only a subset of events for the asset. The event filter should NOT begin with the word 'WHERE'.

Return Value

Boolean

Examples

sCompany = "ABC COMPANY"

sEquip = "ABC123"

sFileName = sCompany & "-" & sEquip & ".zip"

sResult = ExportAsset(sCompany, sEquip, sFileName, "EVENTS.EVENT_DATE > '01/01/2013 12:00:00 AM'")

ShowMessage("Export Result = " & sResult) |