Skip to content

Codeunit WSB_DCAFileMgt

Provides various procedures to process Document Archive files.

Properties

Name Value
Access Public

Methods

wgFncAddFileFromBase64String(RecordId, Code[20], Text, Text, Text, DateTime, Text, DateTime)

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(WSB_DCAFile, RecordId, Text, Text, Text, DateTime, Text, DateTime)

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(WSB_DCAFile, RecordId, Code[20], Text, Text, Text, DateTime, Text, DateTime)

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(RecordId, Codeunit::System#Utilities#Temp Blob, Code[20], Text, Text, DateTime, Text, DateTime)

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(WSB_DCAFile, RecordId, Codeunit::System#Utilities#Temp Blob, Text, Text, DateTime, Text, DateTime)

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(WSB_DCAFile, RecordId, Codeunit::System#Utilities#Temp Blob, Text, Text, DateTime, Text, DateTime, Enum::WSB_DCAFileSourceType)

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(WSB_DCAFile, RecordId, Codeunit::System#Utilities#Temp Blob, Code[20], Text, Text, DateTime, Text, DateTime, Enum::WSB_DCAFileSourceType)

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(WSB_DCAFile@, WSB_DCAFile)

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(WSB_DCAFile)

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(WSB_DCAFile)

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(WSB_DCAFile, Codeunit::System#Utilities#Temp Blob@)

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(RecordRef, Integer):Text

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.

wgFncInitDocArchFileRecord(WSB_DCAFile@, RecordId, Text, Text, DateTime, Text, DateTime, Enum::WSB_DCAFileSourceType, Codeunit::Microsoft#Foundation#NoSeries#NoSeriesManagement@)

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(WSB_DCAFile@, RecordId, Code[20], Text, Text, DateTime, Text, DateTime, Enum::WSB_DCAFileSourceType, Codeunit::Microsoft#Foundation#NoSeries#NoSeriesManagement@)

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(WSB_DCAFile):Boolean

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(WSB_DCAFile@, WSB_DCAFile)

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(WSB_DCAFile, RecordId, Codeunit::System#Utilities#Temp Blob, Text, Text, DateTime, Text, DateTime)

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(WSB_DCAFile@, RecordId, Text, Text, DateTime, Text, DateTime)

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(WSB_DCAFile@, WSB_DCAFile, Boolean@)

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(Text@, Boolean@)

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(WSB_DCAFile, Code[10]@, Text@, Boolean@)

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(WSB_DCAFile@, RecordId, Text, Text)

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(WSB_DCAFile@, WSB_DCAFile, Boolean@)

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(Enum::WSB_DCACategorySelectionMethod, WSB_DCAFile@, WSB_DCAFile, Boolean@)

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(RecordRef, Integer@, Code[20]@, Code[20]@, Integer@, Integer@, Integer@, Boolean@)

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.