Document Posting
If it is intended to customize the process of posting/registering handled documents with the mobile application, it is important to understand the order in which the code is executed:
- First, when the posting command is triggered, the readings from the IDPWHS Read Buffer table are applied to the document lines.
- Next, Business Central is allowed to post/register the document in a standard way.
- Finally, the records from the IDPWHS Read Buffer table, and the questionnaire answers from the IDPWHS Questionnaire Answer table are archived.
This means that if the customizations you want to make are not particular to something in iDynamics Warehouse (e.g. you simply want to trigger a printout every time a shipment is posted), you can use the standard Business Central events and ignore the fact that iDynamics Warehouse is installed in the system.
Even so, iDynamics Warehouse includes several customization events, so you can independently customize what happens when a document posting is triggered from the mobile app, for example.
Posting Events
As mentioned in the overview section, the application has the following events associated with the posting process:
- OnBeforePostFromDevice. Executed when a document is confirmed from the mobile application. This action will apply the readings and post the document, or mark it as finished, depending on the configuration of the warehouse employee.
- OnBeforeProcessReadBuffer. Executed before applying the readings to the document. Readings are applied both when the document is finished from the mobile application and at posting of the document (which could be different times depending on the warehouse employee's configuration).
- OnAfterProcessReadBuffer. Parallel to the previous one, it is executed once the readings have been applied to the document.
- OnBeforeArchiveQuestionnairesAnswers. After posting a document, its answers are archived and associated to the posted document. This event is executed before performing this action.
- OnAfterArchiveQuestionnairesAnswers. Executed after archiving the answers.
The first one (OnBeforePostFromDevice) is executed only when the document posting is launched from the mobile application, and could trigger specific actions that only occur in this case, and not when a document is posted from Business Central.
Permissions to Post
In the warehouse employee card, the application allows to configure whether users can post documents from the mobile application, or if they can only mark the document as finished (pending for someone to review it or perform extra actions in Business Central).
This can be further customized using the IDPWHS_OnBeforeCanPostFromDevice event in the Warehouse Employee table.
IDPWHS_OnBeforeCanPostFromDevice(DocumentType: Enum "IDPWHS App Document Type"; No: Code[20]; var CanPost: Boolean; var Handled: Boolean)
This event receives the following parameters:
- DocumentType. The type of document trying to be posted from the mobile application.
- No. The document number.
- CanPost. Indicates whether the document should be posted (true) or just marked as finished (false).
- Handled. If set to true, iDynamics Warehouse will use the value of the CanPost variable to decide what to do in the posting.