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.

wlEvpOnAfterAddFileFromBlob

Obsolete

This publisher will be replaced by wlEvpOnAfterAddFileFromBlobV2 in a future update (or when DCASetup FileStructureV2Enabled is set) 1.58.0

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 (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.

wlEvpOnAfterAddFileFromBlobV2

Allows to hook into adding a file from a Blob.

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 SystemId 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.

wlEvpOnAfterInitDocArchFileRecord

Obsolete

This publisher will be replaced by wlEvpOnAfterInitDocArchFileRecordV2 in a future update (or when DCASetup FileStructureV2Enabled is set) 1.58.0

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 (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.

wlEvpOnAfterInitDocArchFileRecordV2

Allows to hook into initializing a Document Archive file record.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" vRecWSB_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 SystemId of the source record to attach the file to.
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.

wlEvpOnBeforeCopyRemoteFile

Obsolete

This publisher will be replaced by wlEvpOnBeforeCopyRemoteFileV2 in a future update (or when DCASetup FileStructureV2Enabled is set) 1.58.0

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.

wlEvpOnBeforeCopyRemoteFileV2

Allows to hook into copying a remote file.

Parameters

Type Name Description
`` vRecWSB_DCAFile The new remote file record data.
`` pxRec_WSBDCAFile The old remote file record data.
`` 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

Obsolete

This publisher will be replaced by wlEvpOnBeforeGetRemoteFilePathV2 in a future update (or when DCASetup FileStructureV2Enabled is set) 1.58.0

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.

wlEvpOnBeforeGetRemoteFilePathV2

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

Parameters

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

wlEvpOnBeforeHandleFileAlreadyExistingOnRemote

Allows to hook into how to handle a remote file conflict.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" vRecWSB_DCARemoteFile The file record.
Record "WSB_DCARemoteFile" pRecWSB_DCARemoteFileExisting The file record for the conflicting file.
Text vFileActionStrMenuOptions The StrMenu options to present to the user.
Option vDefaultFileAction The default action to apply.
Text vFileAlreadyExistsQst The question to display to the user.
Boolean vIsHandled Set this to true if your extension handles this remote file conflict.

wlEvpOnBeforeInitDocArchFileRecord

Obsolete

This publisher will be replaced by wlEvpOnBeforeInitDocArchFileRecordV2 in a future update (or when DCASetup FileStructureV2Enabled is set) 1.58.0

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 (starts with dot).

wlEvpOnBeforeInitDocArchFileRecordV2

Allows to hook into initializing a Document Archive file record.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" vRecWSB_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 SystemId of the source record to attach the file to.
Text pFilename The file name.
Text pExtension The file extension (starts with dot).

wlEvpOnBeforeMoveRemoteFile

Obsolete

This publisher will be replaced by wlEvpOnBeforeMoveRemoteFileV2 in a future update (or when DCASetup FileStructureV2Enabled is set) 1.58.0

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.

wlEvpOnBeforeMoveRemoteFileV2

Allows to hook into moving a remote file.

Parameters

Type Name Description
Record "WSB_DCARemoteFile" vRecWSB_DCARemoteFile The file record data.
Boolean vIsHandled Set this to true if your extension handles moving the remote file.

wlEvpOnInitDocArchFileCategory

Obsolete

This publisher will be replaced by wlEvpOnInitDocArchFileCategoryV2 in a future update (or when DCASetup FileStructureV2Enabled is set) 1.58.0

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.

wlEvpOnInitDocArchFileCategoryV2

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_DCARemoteFile" vRecWSB_DCARemoteFile The file record.
Record "WSB_DCARemoteFile" pRecWSB_DCARemoteFileSelected 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.