Customize document handler class

Prev Next

In Connectivity Studio, usually, you can design the integration setup by configuration. Sometimes, it can be required to use a customization. This topic explains the standard document handler classes in Connectivity Studio and how to customize these classes. Only use customized classes if you really need specific functionality.  

Standard document handler classes - External documents - File based

For external file-based documents, several standard handler classes are available. Each external file-based document type has its own handler classes:  

Document type

Handler class

Description

XML

BisDocumentXml

This handler class reads data from or writes data to XML files.

BisDocumentXmlV3

On a message, you can use an XML document in combination with a connector of type Web service, Blob storage, or Upload and download. If you do so, use this handler class instead of BisDocumentXml.

JSON

BisDocumentJson and BisDocumentJSONv2

These handler classes read data from or write data to JSON files. You are advised to use the 'BisDocumentJSONv2' handler class.

BisDocumentJSONV3

On a message, you can use a JSON document in combination with a connector of type Web service, Blob storage, or Upload and download. If you do so, use this handler class instead of BisDocumentJSONv2.

Text

BisDocumentText

This handler class reads data from or writes data to text files.

BisDocumentTextV3

On a message, you can use the Text document in combination with a connector of type Web service, Blob storage, or Upload and download. If you do so, use this handler class instead of BisDocumentText.

BisDocumentTextSingleLine

This handler class only reads data from text files using a record and field separator. Use this handler class if the data of several records is stored in one line in the text file. The following conditions apply:

  • All data is stored in one line in the text file.

  • The data is ordered by key field.

  • The key fields are defined in the document record setup.

BisDocumentTextSingleLineV3

On a message, you can use a single line Text document in combination with a connector of type Web service, Blob storage, or Upload and download. If you do so, use this handler class instead of BisDocumentTextSingleLine.

BisDocumentTextFreeWayIntegration

This handler class reads data from or writes data to text files, using the Freeway Integration Format (FIF). The FIF is an OpenText format. FIF uses the first three characters of a record to identify the record purpose. The first record (**!) and the last record (**@) are defined as fixed text. All other records are handled as standard text with the defined field separator.

BisDocumentTextFreeWayIntegrationV3

On a message, you can use a Freeway Integration Format (FIF) Text document in combination with a connector of type Web service, Blob storage, or Upload and download. If you do so, use this handler class instead of BisDocumentTextFreeWayIntegration.

Fixed text

BisDocumentFixedText

This handler class reads data from or writes data to text files with defined start positions and lengths for records and fields.

BisDocumentFixedTextV3

On a message, you can use a Fixed text document in combination with a connector of type Web service, Blob storage, or Upload and download. If you do so, use this handler class instead of BisDocumentFixedText.

EDI

BisDocumentEdi

This handler class reads data from or writes data to a text file using an EDI standard, for example, EDIFACT or ANSI X12.

BisDocumentEdiV3

On a message, you can use the EDI document in combination with a connector of type Web service, Blob storage, or Upload and download. If you do so, use this handler class, instead of BisDocumentEdi.

BisDocumentEdiTradaComm

This handler class reads data from or writes data to a text file using the TRADACOMS format. Besides several syntax differences, compared to EDIFACT, TRADACOMS employs an '=' as the segment delimiter.

BisDocumentEdiTradaCommV3

On a message, you can use the EDI document in combination with a connector of type Web service, Blob storage, or Upload and download. If you do so, use this handler class, instead of BisDocumentEdiTradaComm.

BisDocumentEDIFACTCounter

This handler class reads data from or writes data to a text file using EDIFACT. With this handler class, you can apply numbering and control counts to your EDI messages. The numbering and counts are only applied on write.
With the 'BisDocumentEDIFACTCounter' handler class you add these values to a message:

  • Header number. Uses the MESSAGEREFERENCENUMBER element of the UNH segment to store the sequential number of the header in the message.

  • Segment count. Uses the NUMBEROFSEGMENTIN and MESSAGEREFERENCENUMBER elements of the UNT segment to store the number of segments within the applicable header. For each header, the segment count starts again.

  • Header count. Uses the INTERCHANGECONTROLCOUNT of the UNZ segment to store the number of headers (UNH segments) in the message.

To apply this, in the document, add the mentioned elements as fields to the applicable records. Example: Add the MESSAGEREFERENCENUMBER field to the UNH record.

BisDocumentEDIFACTCounterV3

On a message, you can use the EDI document in combination with a connector of type Web service, Blob storage, or Upload and download. If you do so, use this handler class, instead of BisDocumentEDIFACTCounter.

BisDocumentEdifactCounterTradaComm

This handler class reads data from or writes data to a text file using TRADACOMS. With this handler class, you can apply numbering and control counts to your EDI Studio messages. The numbering and counts are only applied on write.

BisDocumentEdifactCounterTradaCommV3

On a message, you can use the EDI document in combination with a connector of type Web service, Blob storage, or Upload and download. If you do so, use this handler class, instead of BisDocumentEdifactCounterTradaComm.

Microsoft Excel

BisDocumentExcel

This handler class reads data from or writes data to Microsoft Excel files using Open XML.

BisDocumentExcelV3

On a message, you can use the Microsoft Excel document in combination with a connector of type Blob storage or Upload and download. If you do so, use this handler class instead of BisDocumentExcel.

Microsoft Word

BisDocumentWord

This handler class writes data to Microsoft Word files using Open XML.

BisDocumentWordV3

On a message, you can use the Microsoft Word document in combination with a connector of type Blob storage or Upload and download. If you do so, Use this handler class instead of BisDocumentWord.

Standard document handler classes - External documents - ODBC

For external ODBC documents, several standard handler classes are available:  

Document type

Handler class

Description

ODBC

BisDocumentODBC

This handler class directly reads data from or writes data to an external database.

BisDocumentODBCCData

This handler class directly reads data from or writes data to an external CData database via ODBC. The record names and field names must match the ODBC table names and field names. For each record, fill in the External table field in the Line details section.

BisDocumentODBCForDb2

This handler class directly reads data from or writes data to an external DB2 database via ODBC.

Standard document handler classes - Internal documents

For internal documents, several standard handler classes are available. Each internal document type has its own handler classes:  

Document type

Handler class

Description

D365 F&SCM

BisDocumentAxDatabase

This handler class reads data from or writes data to D365 F&SCM.

BisDocumentAxDatabase_CompanyHeader

If you use EDI, you can also use this handler class. This handler class imports data into D365 F&SCM. On import, it switches to the company as defined in the EDI history and imports the data into that company.

BisDocumentHistoryAxDatabase

This handler class runs the message from the message history. It is automatically applied if you manually run a message from the message history. So, do not select it for a document.

BisDocumentAxDB_SalesOrderPostInvoice

This handler class creates sales orders and automatically reserves the sales quantities. If the quantities are reserved for a sales order, the sales order invoices are created and posted automatically. If the quantities cannot be reserved, the created sales order is deleted.

BisDocumentAxDB_InventCounting

This EDI-specific handler class creates inventory counting journals.

BisDocumentAxPurchaseOrderAutoConfirm

This handler class imports purchase orders and automatically confirms these purchase orders.

BisDocumentAxDatabase_DataEntryWorkflow

This handler class is specific for the Connectivity Studio integration with Data Entry Workflow. Only use this handler class on a target document of a data import message. This handler class starts a data entry workflow. The imported data is imported in the data entry workflow staging table. The data entry workflow tasks are based on the imported data. You can, for example, use this to start a data entry workflow to complete and review the imported data before it is imported in the relevant D365 F&SCM tables. If you select this handler class on the D365 F&SCM document, a Data Entry Workflow section is added to the document header. Here you can select the desired data entry workflow template that is used to start the data entry workflow.

BisDocumentLoyaltyCardPointAdj

This handler class imports loyalty card reward point adjustments. Each adjustment is logged with a unique sequence number.

BisDocumentPickingListRegistration

This handler class imports and creates warehouse orders. When a warehouse order is created, the related picking routes is updated.

BisDocumentPickingListRegistrationCancelUnpicked

This handler class imports and creates picking lists. When a picking list is created, the related picking route is updated. If, at least, one line is picked, all non picked (activated) lines are set to cancelled and the picklist is finished.

BisDocumentPickingListRegistrationPostAll

This handler class imports and creates picking lists. When a picking list is created, the related picking route is updated. Also, the packing slip and the invoice of the linked sales order are posted.

BisDocumentPickingListRegistrationPostAllCancelUnpicked

This handler class imports and creates warehouse orders. When a warehouse order is created, the related picking routes is updated. Also, the packing slip and the invoice of the linked sales order are posted.

BisDocumentPickingListRegistrationPostPackingSlip

This handler class imports and creates the picking list, updates the route, and posts the packing slip.

BisDocumentAxDB_TransferOrderWave

This handler class creates transfer orders. If a created transfer order is validated, it is automatically released.

BisDocumentAxDB_CustVendTransOpen

This handler class exports open customer transactions or vendor transactions, depending on document record setup.

BisMdmDocumentAxDatabase

This handler class exports data from D365 F&SCM for Master Data Management Studio.

BisDocumentWsHistoryAxDatabase

This handler class uses the web service request data to process the web service response, if no response data is received from the web service. Only use this handler class when you process one record at once.

BisDocumentWsHistoryAxDatabaseV2

This handler class uses the web service request data to process the web service response, if no response data is received from the web service. You can use this handler class when you process several record at once.

BisDocumentAxDatabase_DataEntryWorkflow

This handler class starts a data entry workflow. Only use this handler class on a target document on a data import message. The imported data is imported in the data entry workflow staging table. The data entry workflow tasks are based on the imported data.

BisEdiDocumentAxChangeCompany

This handler class runs an EDI Studio message to move data from the staging journal to D365 F&SCM in the company/legal entity as defined in the BisEdiHistory table.

Inventory journal

BisDocumentInventJournal

This handler class imports inventory data into inventory journals. For example: inventory counting results, inventory transfers, or inventory movements. It creates the journal header and links the lines to the created header.

BisDocumentInventJournalApproveWorkflowAutoPost

This handler class automatically submits and posts the inventory journal approval.

Ledger journal

BisDocumentLedgerJournal

This handler class imports ledger-related data into ledger journals. For example: ledger allocations or customer payments. It creates the journal header and links the lines to the created header.

BisEdiDocumentLedgerJournalChangeCompany

If you use EDI Studio, you can also use this handler class. It imports data into the ledger journals. On import, it switches to the company as defined in the EDI history and imports the ledger data into that company.

Trade agreement journal

BisDocumentPriceDiscJournal

This handler class imports trade-agreement-related data into trade agreement journals. For example: discount adjustments or price adjustments. It creates the journal header and links the lines to the created header.

WMS journal

BisDocumentWMSJournal

This handler class can create the journal header and link the lines to the created header. It does not create the journal header automatically. To create the journal header, in the document, add a WMSJournalTable record with a WMSJournalTrans record as a child record.

Report as finished journal

BisDocumentProdParmReportFinish

It creates the journal header and links the lines to the created header.

Production picking list

BisDocumentProdPickList

This handler class can create the journal header and link the lines to the created header. It does not create the journal header automatically. To create the journal header, in the document, add a ProdJournalTable record, and as desired add other records as child records.

Project journal

BisDocumentProjJournal

It creates the journal header and links the lines to the created header.

Staging

BisDocumentStaging

This handler class writes data to or reads data from the staging table. On write, the written staging table record is automatically approved. On approval, the data validations are done. On read, only the journals with journal status 'Approved' and message status 'To be processed' are read.

BisStagingDocumentManualApproval

This handler class writes data to or reads data from the staging table. On write, the data is only written to the staging table. You must manually approve the journals. On approval, the data validations are done. On read, only the journals with journal status 'Approved' and message status 'To be processed' are read.

BisEdiDocumentStagingChangeCompany

If you use EDI Studio, you can also use this handler class. It imports data into the staging table. On import, it switches to the company as defined in the EDI history and imports the data into that company.

Customize document handler classes

You can use a customized document handler class. To do so, extend a standard document handler class.

For each customized document handler class, you can change these methods as desired:

Method

Description

Open

Opens the connection.

onTransactionBegin

Starts the transaction. You can control this method with the Transaction level setting on the message header: Root record or Documents.

onCreateEntity

Returns the entity for a record.

onInitEntity

If the record is not found, it is created.

onWriteField

Writes the value of a field.

onWriteEntity

Writes the entity and defines if it is an update or insert.

onUpdateEntity

Updates the entity.

onInsertEntity

Inserts the entity.

onDeleteEntity

Deletes the entity.

onTransactionCommit

Commits the transaction.

onTransactionAbort

Aborts the transaction.

onErrorEntity

If an error occurs for a source entity, this method is called.

Close

Closes the connection.