Developer Documentation

How to build Reports

To use the advanced document texts in reports or work with them, you first need to find the correct texts.

Hint: If you selected the option that line document texts should be inserted directly into document lines in the setup, you will not have to do further actions to show these texts on the report. You will however still have to take care of the header texts yourself.

Table Selection

First of all, you need to identify the correct table:

  • "kmidt_SalesDocumentText":

    For unposted Sales Documents

  • "kmidt_PstdSalesDocumentText":

    For posted Sales Documents

  • "kmidt_PurchaseDocumentText":

    For unposted Purchase Documents

  • "kmidt_PstdPurchaseDocumentText":

    For posted Purchase Documents

  • "kmidt_FinanceDocumentText":

    For Reminders and Finance Charge Memos

  • "kmidt_IssuedFinDocumentText":

    For issued Reminders and Finance Charge Memos

  • "kmidt_ServiceDocumentText":

    For unposted Service Documents

  • "kmidt_PstdServDocumentText":

    For posted Service Documents

  • "kmidt_ArchSalesDocumentText":

    For archived Sales Documents

  • "kmidt_ArchPurchaseDocumentText":

    For archived Purchase Documents

Filter

To now find the texts for a specific document, you need to filter them as follows:

  • "Document Type":

    The Document Type of the Document to be printed

    Here we are using the standard enums for unposted sales, purchase and service documents:

    • "Sales Document Type"
    • "Purchase Document Type"
    • "Service Document Type"

    For posted documents as well as reminders and finance charge memos we are using custom enums:

    • "kmidt_PstdSalesDocumentType"
    • "kmidt_PstdPurchaseDocumentType"
    • "kmidt_PstdServiceDocumentType"
    • "kmidt_FinanceDocumentTypes"
    • "kmidt_IssuedFinDocumentTypes"
  • "Document No.":

    The Document No. of the Document

  • "Type":

    The Document Text Type

    This is defined in a custom enum "kmidt_DocumentTextType"

    For header document texts, the following values are available:

    • "kmidt_Customer" (for customer related texts)
    • "kmidt_Vendor" (for vendor related texts)
    • "kmidt_Document" (for document type related texts)

    For line document texts, the following values are available:

    • "kmidt_Item" (for item related texts)
    • "kmidt_Resource" (for resource related texts)
    • "kmidt_GLAccount" (for g/l account related texts)
    • "kmidt_FixedAsset" (for asset related texts)
  • "Attached to Line No.":

    The Line No. this text refers to

    For header texts this field needs to be filtered to 0

    For line texts this field needs to be filtered to the target line no.

  • "Text Position":

    The Position of the Text

    This is also defined in a custom enum "kmidt_TextPosition":

    • "kmidt_Leading" (for leading texts)
    • "kmidt_Trailing" (for trailing texts)
  • Validity Checks:

    Every Document Type has a Validity field in all the tables

    For Example: If you need to find a text for a sales order, the field "Sales Order" needs to be filtered to "true"

Report Structure

Example Report: 1305 - "Standard Sales - Order Conf."

Report Example

Custom Events

The following events are available in our codeunits:

"kmidt_CopyDocTextManagement"

  • "OnBeforeReadLines"
  • "OnAfterReadLines"

"kmidt_SalesDocProcedures"

  • "OnBeforeCopySalesDocTexts"
  • "OnBeforeStoreSalesHeaderDocTexts"
  • "OnBeforeRestoreSalesHeaderDocTexts"
  • "OnBeforeCopyFromSalesDocTextToHeader"
  • "OnBeforeStoreSalesLineDocTexts"
  • "OnBeforeSalesDocCheckIfAnyExtText"
  • "OnAfterSalesDocCheckIfAnyExtText"
  • "OnBeforeCustomerCheckIfAnyExtText"
  • "OnAfterCustomerCheckIfAnyExtText"
  • "OnBeforeInsertSalesDocText"
  • "OnBeforeSalesLineCheckIfAnyExtText"
  • "OnBeforeCheckAndInsertSalesLineTexts"
  • "OnBeforeGetSalesTextType"
  • "OnBeforeFindNextPstdSalesDocTextLineNo"
  • "OnAfterCopySalesDocTexts"
  • "OnAfterStoreSalesHeaderDocTexts"
  • "OnAfterRestoreSalesHeaderDocTexts"
  • "OnAfterCopyFromSalesDocTextToHeader"
  • "OnAfterStoreSalesLineDocTexts"
  • "OnAfterInsertSalesDocText"
  • "OnAfterSalesLineCheckIfAnyExtText"
  • "OnAfterCheckAndInsertSalesLineTexts"
  • "OnAfterGetSalesTextType"
  • "OnAfterFindNextPstdSalesDocTextLineNo"

"kmidt_PurchDocProcedures"

  • "OnBeforeCopyPurchDocTexts"
  • "OnBeforeStorePurchHeaderDocTexts"
  • "OnBeforeStorePurchaseLineDocTexts"
  • "OnBeforePurchDocCheckIfAnyExtText"
  • "OnAfterPurchDocCheckIfAnyExtText"
  • "OnBeforeVendorCheckIfAnyExtText"
  • "OnAfterVendorCheckIfAnyExtText"
  • "OnBeforeInsertPurchDocText"
  • "OnBeforePurchLineCheckIfAnyExtText"
  • "OnBeforeCheckAndInsertPurchLineTexts"
  • "OnBeforeGetPurchaseTextType"
  • "OnBeforeCopyFromPurchDocTextToHeader"
  • "OnBeforeFindNextPstdPurchDocTextLineNo"
  • "OnAfterCopyPurchDocTexts"
  • "OnAfterStorePurchHeaderDocTexts"
  • "OnAfterStorePurchaseLineDocTexts"
  • "OnAfterInsertPurchDocText"
  • "OnAfterPurchLineCheckIfAnyExtText"
  • "OnAfterCheckAndInsertPurchLineTexts"
  • "OnAfterGetPurchaseTextType"
  • "OnAfterCopyFromPurchDocTextToHeader"
  • "OnAfterFindNextPstdPurchDocTextLineNo"

"kmidt_ServiceDocProcedures"

  • "OnBeforeCopyServHeaderDocTexts"
  • "OnBeforeServDocCheckIfAnyExtText"
  • "OnAfterServDocCheckIfAnyExtText"
  • "OnBeforeCustomerCheckIfAnyExtServText"
  • "OnAfterCustomerCheckIfAnyExtServText"
  • "OnBeforeInsertServDocText"
  • "OnAfterCopyServHeaderDocTexts"
  • "OnAfterInsertServDocText"

"kmidt_FinanceDocProcedures"

  • "OnBeforeCopyFinChrgMemoHeaderDocTexts"
  • "OnBeforeCopyReminderHeaderDocTexts"
  • "OnBeforeReminderDocCheckIfAnyExtText"
  • "OnAfterReminderDocCheckIfAnyExtText"
  • "OnBeforeInsertFinDocText"
  • "OnBeforeFinChrgMemoDocCheckIfAnyExtText"
  • "OnAfterFinChrgMemoDocCheckIfAnyExtText"
  • "OnBeforeReminderCustCheckIfAnyExtText"
  • "OnAfterReminderCustCheckIfAnyExtText"
  • "OnBeforeFinChrgMemoCustCheckIfAnyExtText"
  • "OnAfterFinChrgMemoCustCheckIfAnyExtText"
  • "OnAfterCopyFinChrgMemoHeaderDocTexts"
  • "OnAfterCopyReminderHeaderDocTexts"
  • "OnAfterInsertFinDocText"

Program Flowcharts

From Master Data to Document

General Document Text (Example: Sales Order)

General Document Text


Customer/Vendor Document Text (Example: Sales Order, Customer)

Customer Document Text


Line Document Text (Example: Sales Order, Item)

Line Document Text


From one Document to another

From one to another