Skip to main content

Using Direct OData Submit and Direct Button with Workflow in D365CE - Knowledgebase / Lasernet CE Connector / Lasernet CE Connector General Information - Formpipe Support Portal

Using Direct OData Submit and Direct Button with Workflow in D365CE

Authors list

This article describes the steps required to set up a workflow in D365 CE to invoke the plugin for submitting printing contracts to D365FO. This will allow an Odata dialog printing contract to be sent to D365FO in response to an event in D365 CE.


There are two ways to invoke the logic in D365 FO without user-interaction, either using a direct OData submit or by using a direct button which then invokes direct OData submit. The advantage of using the logic for direct buttons is that it is not needed to hardcode the process/caller to a direct OData submit record ID. Instead, it is mapped to the control ID on the Lasernet Button form, which then maps to the direct OData submit or HTTP method. Performance is better when using direct OData submit, however, it’s easier to maintain a direct button.


Using Direct OData Submit

1. Create a Lasernet Direct OData submit record. It is recommended to test and confirm that it is working by attaching it to a flyout or button.

2. Obtain the ID of the Lasernet Direct OData submit record and copy it from the URL. There are several ways to do this. In this example, Power pane Plugin in the browser is used to get the Record ID.

3. Create a new process/workflow for the entity in question. 

If this process is an action and you want to use it in a Business Process Flow, then select the As a Business Process Flow action step checkbox and set “As an on-demand process”, if required. 

4. Add the step Lasernet.Unified.Printing.Activities.ODataDirectSubmit.

5. Set “The ID of OData Direct Submit” to the ID you found in step 2.

6. Set “Inbound serialized contract (will be returned)” to a JSON object. OrgName is currently a requirement in D365 FO, so add it (either hardcode or using arguments). OrgName can be found from the Developer Resources area under Settings > Customizations. The JSON object will be sent to FO, where it can be used for report mapping and filtering.

You can also set the remaining fields, however, they are optional.

7. Add your own logic to the process and/or set when it should be started and activate it.

Optional

Option 1 : Set Properties for Workflow Activity for Lasernet.Unified.Printing.Activities.ODataDirectSubmit


Option 2: Add a workflow action and specify OdataDirectSubmitId and Inbound Contract


Using Direct Button with Workflow

1. Create a Lasernet button and assign a meaningful unique name to controlId. It will be the ID that is matched in step 5.

2. Create a Lasernet Direct OData submit record and assign it to the button. It is recommended to test the button, just to confirm that it is working.

If you do not want the button to be displayed, then hide it using a dummy criterion, which matches nothing (entities do not exist). Apply the same criterion to the properties of the process step (primary and/or selected entity) in step 5.

3. Create a new process for the entity in question. If this process is an action and you want to use it in a Business Process Flow, then select the  As a Business Process Flow action step checkbox. Set As an on-demand process, if required.

4. Add the step Lasernet.Unified.Printing.Activities.DirectButton.

5. Set “The ID passed on from the control” to the controlId you added in step 1.

6. Set “The data which are to be sent” to a json object. OrgName is currently a requirement in D365 FO, so add it (either hardcode or using arguments).

 The json object will be sent to FO, where it can be used for report mapping and filtering.

 

 An example:

 {"AccountID": "{Account Number(Account)}", "OrgName": "orga12345" , "InvokedFrom": "MyAccountWorkflow" } The yellow marking is added from the Account entity.

You can also set the remaining fields, however, they are optional.

7. Add your own logic to the process and/or set when it should be started.

8. Activate it.

Helpful Unhelpful

0 of 1 people found this page helpful

Add a comment

Please log in or register to submit a comment.

Need a password reminder?

Share