Create Processing Journal

In this step, a delayed update of indexdata entry for the Therefore™ Business Central Connector is created. This ensures that it updates the index data when the invoice is posted so Therefore™ is updated with the new invoice number that is created on posting. Which index data fields should be updated still has to be defined by a mapping (associated with tbe TableID 122) in the Connector.

Endpoint:
https://api.businesscentral.dynamics.com/v2.0/<environment name>/api/therefore/connector/v1.0/companies(<company id>)/processingjournals

Body Mapping:

JSON Name JSON Value

TableID

122

DocumentNo

IndexData.GetField(“Invoice_No”)

NAVDocumentID

parseInt(IndexData.GetField("InvoiceID")

CategoryID

<Therefore™ category number for this workflow>

Status

“delayed update of indexdata”

  • 122 is the Table ID of the Purchase Invoice Header.

  • The CategoryID has to match the category of the workflow.

  • The Status has to be set to “delayed update of indexdata” (this exact wording, with quotes) as a command that index data should be updated.

  • NAVDocumentID has to be an integer value. If IndexData.GetField("LinkId") already returns an integer it can be used as is. If not, the JavaScript function parseInt can be used to convert a text value into an integer.