Interface

Interface

We have provided an interface codeunit so you can add Red Ink Texts from third party extensions. This is codeunit 11310933, "Red Ink Text Interface".

The codeunit has these four methods.

InsertTextInterface with HTML text

/// <summary>
/// Insert the text from any source table
/// </summary>
/// <param name="RecVar">The record for which you are adding text.</param>
/// <param name="Type">The text type from the Red Ink Text Type table</param>
/// <param name="Description">The text description</param>
/// <param name="FlowToTransaction">Specifies if the text should flow with the document flow, quote, order, invoice</param>
/// <param name="TextOrder">The order in which the text should be displayed on the document</param>
/// <param name="DocumentDate">The date for the document</param>
/// <param name="htmlText">The encoded text you want to add. Can be plain text or html formatted</param>///
/// <param name="htmlText">Use "Type Helper".HtmlEncode() to html encode your pain text</param>
/// <returns>The generated preview text</returns>
procedure InsertTextInterface(RecVar: Variant; Type: Code[20]; Description: Text; FlowToTransaction: Boolean; TextOrder: Integer; DocumentDate: Date; htmlText: Text): Text

InsertTextInterface without html text

/// <summary>
/// Insert the text from any source table. If Apply Automatically is enabled on a relevant template that template is used.
/// </summary>
/// <param name="RecVar">The record for which you are adding text.</param>
/// <param name="Type">The text type from the Red Ink Text Type table</param>
/// <param name="Description">The text description</param>
/// <param name="FlowToTransaction">Specifies if the text should flow with the document flow, quote, order, invoice</param>
/// <param name="TextOrder">The order in which the text should be displayed on the document</param>
/// <param name="DocumentDate">The date for the document</param>
/// <returns>The generated Red Ink Text Entry No</returns>
procedure InsertTextInterface(RecVar: Variant; Type: Code[20]; Description: Text; FlowToTransaction: Boolean; TextOrder: Integer; DocumentDate: Date): Integer

InsertTextInterface for text only

/// <summary>
/// Insert the text for a Red Ink Text
/// </summary>
/// <param name="InkTextEntryNo">The record for which you are adding text.</param>
/// <param name="htmlText">The encoded text you want to add. Can be plain text or html formatted</param>///
/// <param name="htmlText">Use "Type Helper".HtmlEncode() to html encode your pain text</param>
/// <returns>The generated preview text</returns>
procedure InsertTextInterface(InkTextEntryNo: Integer; HtmlText: Text): Text

InsertTextFromTemplateInterface

/// <summary>
/// Insert the template text from any source table
/// </summary>
/// <param name="RecVar">The record for which you are adding text.</param>
/// <param name="TemplateCode">The text you want to add. Can be plain text or html formatted</param>///
/// <returns>The generated Red Ink Text Entry No</returns>
procedure InsertTextFromTemplateInterface(RecVar: Variant; TemplateCode: Code[20]): Integer

ReplaceTextFromTemplateInterface

/// <summary>
/// Replace the existing text of an Ink Text Entry with template text from any source table
/// </summary>
/// <param name="InkTextEntryNo">The record for which you are adding text.</param>
/// <param name="RecVar">The record for which you are adding text.</param>
/// <param name="TemplateCode">The template you want to use to create the text.</param>
/// <returns>The generated Red Ink Text Entry No</returns>
procedure ReplaceTextFromTemplateInterface(InkTextEntryNo: Integer; RecVar: Variant; TemplateCode: Code[20]): Integer

GetMergedTextFromTemplate

/// <summary>
/// Generate text from a template. Replaces the template placeholders with data from the record.
/// </summary>
/// <param name="TemplateCode">The template you want to use to create the text.</param>
/// <param name="RecVar">The record you want to use to create the text. This must match the record that the template is built on.</param>
/// <returns>The generated text</returns>
procedure GetMergedTextFromTemplate(TemplateCode: Code[20]; RecVar: Variant): Text