Skip to content

Codeunit WSB_DCAFileMgt

Provides various procedures to process Document Archive files.

Properties

Name Value
Access Public

Methods

wgFncAddFileFromBase64String

Adds a new file to the Document Archive from a Base64 string to the configured Document Archive file storage.

Parameters

Type Name Description
RecordId pSourceRecID The Record ID of the source record to attach the file to.
Code[20] pCategoryCode The code of the category the file should be categorized in. If empty, the category will be determined based on the settings in the Document Archive setup.
Text pBase64String The Base64 string containing the file contents.
Text pFilename The file name.
Text pExtension The file extension (starts with dot).
DateTime pFileCreatedDateTime The file creation date.
Text pMessageFrom The sender of the file/mail.
DateTime pMessageSentOn The date the file/mail was sent.

wgFncAddFileFromBase64String

Adds a new file to the Document Archive from a Base64 string to the configured Document Archive file storage.

Parameters

Type Name Description
Integer pTableNo The Table No. of the source record to attach the file to.
Guid pSystemId The System ID of the source record to attach the file to.
Code[20] pCategoryCode The code of the category the file should be categorized in. If empty, the category will be determined based on the settings in the Document Archive setup.
Text pBase64String The Base64 string containing the file contents.
Text pFilename The file name.
Text pExtension The file extension (starts with dot).
DateTime pFileCreatedDateTime The file creation date.
Text pMessageFrom The sender of the file/mail.
DateTime pMessageSentOn The date the file/mail was sent.

wgFncAddFileFromBase64String

Adds a new file to the Document Archive from a Base64 string to the configured Document Archive file storage.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" pRecWSB_DCARemoteFile A record containing information on the source record to attach the file to.
RecordId pSourceRecID The Record ID of the source record to attach the file to.
Text pBase64String The Base64 string containing the file contents.
Text pFilename The file name.
Text pExtension The file extension (starts with dot).
DateTime pFileCreatedDateTime The file creation date.
Text pMessageFrom The sender of the file/mail.
DateTime pMessageSentOn The date the file/mail was sent.

wgFncAddFileFromBase64String

Adds a new file to the Document Archive from a Base64 string to the configured Document Archive file storage.

Parameters

Type Name Description
Record "WSB_DCARemoteFileLink" pRecWSB_DCARemoteFileLink A record containing information on the source record to attach the file to.
RecordId pSourceRecID The Record ID of the source record to attach the file to.
Text pBase64String The Base64 string containing the file contents.
Text pFilename The file name.
Text pExtension The file extension (starts with dot).
DateTime pFileCreatedDateTime The file creation date.
Text pMessageFrom The sender of the file/mail.
DateTime pMessageSentOn The date the file/mail was sent.

wgFncAddFileFromBase64String

Adds a new file to the Document Archive from a Base64 string to the configured Document Archive file storage.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" pRecWSB_DCARemoteFile A record containing information on the source record to attach the file to.
RecordId pSourceRecID The Record ID of the source record to attach the file to.
Code[20] pCategoryCode The code of the category the file should be categorized in. If empty, the category will be determined based on the settings in the Document Archive setup.
Text pBase64String The Base64 string containing the file contents.
Text pFilename The file name.
Text pExtension The file extension (starts with dot).
DateTime pFileCreatedDateTime The file creation date.
Text pMessageFrom The sender of the file/mail.
DateTime pMessageSentOn The date the file/mail was sent.

wgFncAddFileFromBase64String

Adds a new file to the Document Archive from a Base64 string to the configured Document Archive file storage.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" pRecWSB_DCARemoteFile A record containing information on the source record to attach the file to.
Integer pTableNo The Table No. of the source record to attach the file to.
Guid pSystemId The System ID of the source record to attach the file to.
Code[20] pCategoryCode The code of the category the file should be categorized in. If empty, the category will be determined based on the settings in the Document Archive setup.
Text pBase64String The Base64 string containing the file contents.
Text pFilename The file name.
Text pExtension The file extension (starts with dot).
DateTime pFileCreatedDateTime The file creation date.
Text pMessageFrom The sender of the file/mail.
DateTime pMessageSentOn The date the file/mail was sent.

wgFncAddFileFromBlob

Adds a new file to the Document Archive from a Blob to the configured Document Archive file storage.

Parameters

Type Name Description
RecordId pSourceRecID The Record ID of the source record to attach the file to.
Codeunit "Temp Blob" pCduTempBlob The TempBlob containing the file contents.
Code[20] pCategoryCode The code of the category the file should be categorized in. If empty, the category will be determined based on the settings in the Document Archive setup.
Text pFilename The file name.
Text pExtension The file extension (starts with dot).
DateTime pFileCreatedDateTime The file creation date.
Text pMessageFrom The sender of the file/mail.
DateTime pMessageSentOn The date the file/mail was sent.

wgFncAddFileFromBlob

Adds a new file to the Document Archive from a Blob to the configured Document Archive file storage.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" pRecWSB_DCARemoteFile A record containing information on the source record to attach the file to.
RecordId pSourceRecID The Record ID of the source record to attach the file to.
Codeunit "Temp Blob" pCduTempBlob The TempBlob containing the file contents.
Text pFilename The file name.
Text pExtension The file extension (starts with dot).
DateTime pFileCreatedDateTime The file creation date.
Text pMessageFrom The sender of the file/mail.
DateTime pMessageSentOn The date the file/mail was sent.

wgFncAddFileFromBlob

Adds a new file to the Document Archive from a Blob to the configured Document Archive file storage.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" pRecWSB_DCARemoteFile A record containing information on the source record to attach the file to.
RecordId pSourceRecID The Record ID of the source record to attach the file to.
Codeunit "Temp Blob" pCduTempBlob The TempBlob containing the file contents.
Text pFilename The file name.
Text pExtension The file extension (starts with dot).
DateTime pFileCreatedDateTime The file creation date.
Text pMessageFrom The sender of the file/mail.
DateTime pMessageSentOn The date the file/mail was sent.
Enum "WSB_DCAFileSourceType" pFileSourceType The method which was used to add file to the Document Archive

wgFncAddFileFromBlob

Adds a new file to the Document Archive from a Blob to the configured Document Archive file storage.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" pRecWSB_DCARemoteFile A record containing information on the source record to attach the file to.
RecordId pSourceRecID The Record ID of the source record to attach the file to.
Codeunit "Temp Blob" pCduTempBlob The TempBlob containing the file contents.
Code[20] pCategoryCode The code of the category the file should be categorized in. If empty, the category will be determined based on the settings in the Document Archive setup.
Text pFilename The file name.
Text pExtension The file extension (starts with dot).
DateTime pFileCreatedDateTime The file creation date.
Text pMessageFrom The sender of the file/mail.
DateTime pMessageSentOn The date the file/mail was sent.
Enum "WSB_DCAFileSourceType" pFileSourceType The method which was used to add file to the Document Archive

wgFncAddFileFromBlob

Adds a new file to the Document Archive from a Blob to the configured Document Archive file storage.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" pRecWSB_DCARemoteFile A record containing information on the source record to attach the file to.
RecordId pSourceRecID The Record ID of the source record to attach the file to.
Codeunit "Temp Blob" pCduTempBlob The TempBlob containing the file contents.
Code[20] pCategoryCode The code of the category the file should be categorized in. If empty, the category will be determined based on the settings in the Document Archive setup.
Text pFilename The file name.
Text pExtension The file extension (starts with dot).
DateTime pFileCreatedDateTime The file creation date.
Text pMessageFrom The sender of the file/mail.
DateTime pMessageSentOn The date the file/mail was sent.
Enum "WSB_DCAFileSourceType" pFileSourceType The method which was used to add file to the Document Archive

wgFncCopyRemoteFile

Copy a file to a new location on the remote file storage.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" vRecWSB_DCARemoteFileTarget The new remote file record values.
Record "WSB_DCARemoteFile" pRec_WSBDCARemoteFileSource The old remote file record values.

wgFncDeleteFile

Deletes the file associated with the Document Archive Remote File Link record from the configured Document Archive file storage.

Parameters

Type Name Description
Record "WSB_DCARemoteFileLink" pRecWSB_DCARemoteFileLink The record link to the record that the file to delete is attached to.

wgFncDeleteFile

Deletes the file associated with the Document Archive Remote File record from the configured Document Archive file storage.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" pRecWSB_DCARemoteFile The record that the file to delete is attached to.

wgFncDownloadFile

Downloads the file associated with the Document Archive Remote File record from the configured Document Archive file storage.

Parameters

Type Name Description
Record "WSB_DCARemoteFileLink" pRecWSB_DCARemoteFileLink The Link record to The Remote file record that the file to download is attached to.

wgFncDownloadFile

Downloads the file associated with the Document Archive File record from the configured Document Archive file storage.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" pRecWSB_DCARemoteFile The record that the file to download is attached to.

wgFncDownloadFile

Downloads the file associated with the Document Archive Remote File record from the configured Document Archive file storage.

Parameters

Type Name Description
Record "WSB_DCARemoteFileLink" pRecWSB_DCARemoteFileLink The Link record to The Remote file record that the file to download is attached to.
Codeunit "Temp Blob" vCduTempBlob A TempBlob containing the downloaded file contents.

wgFncDownloadFile

Downloads the file associated with the Document Archive File record from the configured Document Archive file storage.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" pRecWSB_DCARemoteFile The record that the file to download is attached to.
Codeunit "Temp Blob" vCduTempBlob A TempBlob containing the downloaded file contents.

wgFncGetFieldValue

Gets formatted field text value for a given RecordRef and FieldNo.

Parameters

Type Name Description
RecordRef pRecRef The RecordRef containing the field value.
Integer pFieldNo The FieldNo to get the formatted field value from.

Returns

Type Description
Text The formatted field text value.

wgFncInitDocArchFileRecordV2

Initializes the fields for a new Document Archive file record.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" vRecWSB_DCARemoteFile The file record.
RecordId pSourceRecID The source record ID.
Text pFilename The file name.
Text pExtension The file extension (starts with dot).
DateTime pFileCreatedDateTime The file creation date-time.
Text pMessageFrom Email address of who the email message was from (for .msg files).
DateTime pMessageSentOn The date and time of the email message.
Enum "WSB_DCAFileSourceType" pFileSourceType The origin of the file record.
Codeunit "No. Series - Batch" vCduNoSeriesBatch Instance of the No. Series - Batch codeunit to be used for getting a new No. for the file record.

wgFncInitDocArchFileRecordV2

Initializes the fields for a new Document Archive file record.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" vRecWSB_DCARemoteFile The file record.
RecordId pSourceRecID The source record ID.
Code[20] pCategoryCode The code of the category the file should be categorized in. If empty, the category will be determined based on the settings in the Document Archive setup.
Text pFilename The file name.
Text pExtension The file extension (starts with dot).
DateTime pFileCreatedDateTime The file creation date-time.
Text pMessageFrom Email address of who the email message was from (for .msg files).
DateTime pMessageSentOn The date and time of the email message.
Enum "WSB_DCAFileSourceType" pFileSourceType The origin of the file record.
Codeunit "No. Series - Batch" vCduNoSeriesBatch Instance of the "No. Series - Batch" codeunit to be used for getting a new No. for the file record.

wgFncInitDocArchFileRecordV2

Initializes the fields for a new Document Archive file record.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" vRecWSB_DCARemoteFile The file record.
Integer pTableNo Table No
Guid pSystemId Systemid of the record
Code[20] pCategoryCode The code of the category the file should be categorized in. If empty, the category will be determined based on the settings in the Document Archive setup.
Text pFilename The file name.
Text pExtension The file extension (starts with dot).
DateTime pFileCreatedDateTime The file creation date-time.
Text pMessageFrom Email address of who the email message was from (for .msg files).
DateTime pMessageSentOn The date and time of the email message.
Enum "WSB_DCAFileSourceType" pFileSourceType The origin of the file record.
Codeunit "No. Series - Batch" vCduNoSeriesBatch Instance of the "No. Series - Batch" codeunit to be used for getting a new No. for the file record.

wgFncIsFileForCurrentEnvironmentAndCompany

Returns whether the file record applies to the current BC environment and company.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" pRecWSB_DCARemoteFile The file record.

Returns

Type Description
Boolean true iff the file belongs to the current BC environment and company.

wgFncMoveRemoteFile

Moves a file to a new location on the remote file storage.

Parameters

Type Name Description
`` vRecWSB_DCARemoteFile The new file record values.
`` pSuspendDownloadError Suspend error on download failure.
`` pxRec_WSBDCAFile The old file record values.