Codeunit "Word Template Interactions"

ID 5069
Namespace: Microsoft.CRM.Interaction

Methods

Merge

Performs mail merge on the Word templates from the attachments specified by TempDeliverySorterWord and sends them according to the correspondence Type.

procedure Merge(var TempDeliverySorterWord: Record "Delivery Sorter" temporary)

Parameters

Name Type Description
TempDeliverySorterWord Table Microsoft.CRM.Interaction."Delivery Sorter"

A temporary table containing information about attachments and their recipients.

RunMergedDocument

Download a merged Word template for a given segment line and attachment.

procedure RunMergedDocument(var SegLine: Record "Segment Line", var Attachment: Record Attachment)

Parameters

Name Type Description
SegLine Table Microsoft.CRM.Segment."Segment Line"

Specifies the segment line for which the attachment is for.

Attachment Table Microsoft.CRM.Interaction.Attachment

Specifies the attachemnt (Word template) to be downloaded.

IsWordDocumentExtension

Checks if the provided file extension is a Word document extension.

procedure IsWordDocumentExtension(FileExtension: Text): Boolean

Parameters

Name Type Description
FileExtension Text

File extension to check.

Returns

Type Description
Boolean

True if the provided extension is a Word document extension, false otherwise.

Events

OnBeforeCreateInteractionWordTemplate

[IntegrationEvent(False,False)]
internal procedure OnBeforeCreateInteractionWordTemplate(var WordTemplateCreationWizard: Page "Word Template Creation Wizard")

Parameters

Name Type Description
WordTemplateCreationWizard Page System.Integration.Word."Word Template Creation Wizard"

OnGetDataSourceOnBeforeRestoreGlobalLanguage

[IntegrationEvent(False,False)]
local procedure OnGetDataSourceOnBeforeRestoreGlobalLanguage(var DataSource: Dictionary of [Text, Text], var InteractLogEntry: Record "Interaction Log Entry", var SegLine: Record "Segment Line")

Parameters

Name Type Description
DataSource Dictionary of [Text, Text]
InteractLogEntry Table Microsoft.CRM.Interaction."Interaction Log Entry"
SegLine Table Microsoft.CRM.Segment."Segment Line"

OnBeforeSendMergedDocument

[IntegrationEvent(False,False)]
local procedure OnBeforeSendMergedDocument(MergedDocumentInStream: InStream, TempDeliverySorter: Record "Delivery Sorter", ToAddress: Text, InteractionLogEntry: Record "Interaction Log Entry", var IsHandled: Boolean)

Parameters

Name Type Description
MergedDocumentInStream InStream
TempDeliverySorter Table Microsoft.CRM.Interaction."Delivery Sorter"
ToAddress Text
InteractionLogEntry Table Microsoft.CRM.Interaction."Interaction Log Entry"
IsHandled Boolean

OnExecuteMergeOnBeforeMergeWordTemplates

[IntegrationEvent(False,False)]
local procedure OnExecuteMergeOnBeforeMergeWordTemplates(TempDeliverySorter: Record "Delivery Sorter" temporary, InteractLogEntry: Record "Interaction Log Entry", var SaveFormat: Enum "Word Templates Save Format")

Parameters

Name Type Description
TempDeliverySorter Table Microsoft.CRM.Interaction."Delivery Sorter"
InteractLogEntry Table Microsoft.CRM.Interaction."Interaction Log Entry"
SaveFormat Enum System.Integration.Word."Word Templates Save Format"

OnExecuteMergeOnAfterGetInteractLogEntry

[IntegrationEvent(False,False)]
local procedure OnExecuteMergeOnAfterGetInteractLogEntry(InteractionLogEntry: Record "Interaction Log Entry")

Parameters

Name Type Description
InteractionLogEntry Table Microsoft.CRM.Interaction."Interaction Log Entry"

OnGetDataSourceOnBeforeAddDataSources

[IntegrationEvent(False,False)]
local procedure OnGetDataSourceOnBeforeAddDataSources(var DataSource: Dictionary of [Text, Text], var InteractionLogEntry: Record "Interaction Log Entry", var Contact: Record Contact, var SalespersonPurchaser: Record "Salesperson/Purchaser", var CountryRegion: Record "Country/Region", LineNo: Text, ContactAltAddressCode: Code[10], LanguageCode: Code[10], ActiveDate: Date, var IsHandled: Boolean)

Parameters

Name Type Description
DataSource Dictionary of [Text, Text]
InteractionLogEntry Table Microsoft.CRM.Interaction."Interaction Log Entry"
Contact Table Microsoft.CRM.Contact.Contact
SalespersonPurchaser Table Microsoft.CRM.Team."Salesperson/Purchaser"
CountryRegion Table Microsoft.Foundation.Address."Country/Region"
LineNo Text
ContactAltAddressCode Code[10]
LanguageCode Code[10]
ActiveDate Date
IsHandled Boolean

OnExecuteMergeOnBeforeInteractionMergeDataInsert

[IntegrationEvent(False,False)]
local procedure OnExecuteMergeOnBeforeInteractionMergeDataInsert(var InteractionMergeData: Record "Interaction Merge Data", var InteractionLogEntry: Record "Interaction Log Entry")

Parameters

Name Type Description
InteractionMergeData Table Microsoft.CRM.Interaction."Interaction Merge Data"
InteractionLogEntry Table Microsoft.CRM.Interaction."Interaction Log Entry"

See also