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.
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_DCAFile" pRecWSB_DCAFile 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.
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_DCAFile" pRecWSB_DCAFile 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.
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.
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_DCAFile" pRecWSB_DCAFile 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.
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_DCAFile" pRecWSB_DCAFile 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.
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_DCAFile" pRecWSB_DCAFile 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.
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_DCAFile" vRecWSB_DCAFileTarget The new file record values.
Record "WSB_DCAFile" pRec_WSBDCAFileSource The old file record values.

wgFncDeleteFile

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

Parameters

Type Name Description
Record "WSB_DCAFile" pRecWSB_DCAFile The record that the file to delete 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_DCAFile" pRecWSB_DCAFile The 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_DCAFile" pRecWSB_DCAFile 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.

wgFncInitDocArchFileRecord

Initializes the fields for a new Document Archive file record.

Parameters

Type Name Description
Record "WSB_DCAFile" vRecWSB_DCAFile The file record.
RecordId pSourceRecID The source record ID.
Text pFilename The file name.
Text pExtension The file extension.
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 "NoSeriesManagement" vCduNoSeriesMgt Instance of the No. Series Mgt. codeunit to be used for getting a new No. for the file record.

wgFncInitDocArchFileRecord

Initializes the fields for a new Document Archive file record.

Parameters

Type Name Description
Record "WSB_DCAFile" vRecWSB_DCAFile 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.
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 "NoSeriesManagement" vCduNoSeriesMgt Instance of the No. Series Mgt. 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_DCAFile" pRecWSB_DCAFile 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
Record "WSB_DCAFile" vRecWSB_DCAFile The new file record values.
Record "WSB_DCAFile" pxRec_WSBDCAFile The old file record values.

wlEvpOnAfterAddFileFromBlob

Allows to hook into adding a file from a Blob.

Parameters

Type Name Description
Record "WSB_DCAFile" pRecWSB_DCAFile 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.
DateTime pFileCreatedDateTime The file creation date.
Text pMessageFrom The sender of the file/mail.
DateTime pMessageSentOn The date the file/mail was sent.

wlEvpOnAfterInitDocArchFileRecord

Allows to hook into initializing a Document Archive file record.

Parameters

Type Name Description
Record "WSB_DCAFile" vRecWSB_DCAFile 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 pFilename The file name.
Text pExtension The file extension.
DateTime pFileCreatedDateTime The file creation date.
Text pMessageFrom The sender of the file/mail.
DateTime pMessageSentOn The date the file/mail was sent.

wlEvpOnBeforeCopyRemoteFile

Allows to hook into copying a remote file.

Parameters

Type Name Description
Record "WSB_DCAFile" vRecWSB_DCAFile The new file record data.
Record "WSB_DCAFile" pxRec_WSBDCAFile The old file record data.
Boolean vIsHandled Set this to true if your extension handles copying the remote file.

wlEvpOnBeforeGetEnvironmentName

Allows to hook into retrieving the BC environment name.

Parameters

Type Name Description
Text vEnvironmentName The environment name.
Boolean vIsHandled Set this to true if your extension handles getting the current environment.

wlEvpOnBeforeGetRemoteFilePath

Allows to hook into getting the remote file path for a file record.

Parameters

Type Name Description
Record "WSB_DCAFile" pRecWSB_DCAFile The file record.
Code[10] vLanguageCode Language code to use for translating the generated path.
Text vFilePath The result remote file path.
Boolean vIsHandled Set this to true if your extension handles getting the remote file path.

wlEvpOnBeforeInitDocArchFileRecord

Allows to hook into initializing a Document Archive file record.

Parameters

Type Name Description
Record "WSB_DCAFile" vRecWSB_DCAFile 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 pFilename The file name.
Text pExtension The file extension.

wlEvpOnBeforeMoveRemoteFile

Allows to hook into moving a remote file.

Parameters

Type Name Description
Record "WSB_DCAFile" vRecWSB_DCAFile The new file record data.
Record "WSB_DCAFile" pxRec_WSBDCAFile The old file record data.
Boolean vIsHandled Set this to true if your extension handles moving the remote file.

wlEvpOnInitDocArchFileCategory

Allows to hook into setting the Document Archive file category for a file record.

Parameters

Type Name Description
Enum "WSB_DCACategorySelectionMethod" pCategorySelectionMethod The category selection method (from the setup).
Record "WSB_DCAFile" vRecWSB_DCAFile The file record.
Record "WSB_DCAFile" pRecWSB_DCAFileSelected The file record selected on the page/factbox.
Boolean vIsHandled Set this to true if your extension handles setting the document archive file category for the file record.

wlEvpOnSetPrimaryValues

Allows one to support additional source record types that Document Archive files can be linked.

Parameters

Type Name Description
RecordRef pRecRef The source record as RecordRef.
Integer vSourceType The type of the source record (if applicable).
Code[20] vSourceNo The no. of the source record (if applicable).
Code[20] vSourceSubNo The sub no. of the source record (if applicable).
Integer vSourceNoOccurrence The occurrence of the no. of the source record (if applicable).
Integer vSourceVersionNo The version no. of the source record (if applicable).
Integer vSourceLineNo The line no. of the source record (if applicable).
Boolean vIsHandled Set this to true if your extension handles setting the source link field values for the record type specified in the RecordRef.