Purpose


The purpose of this article is to describe steps required to setup a workflow in D365CE to invoke the plugin for submitting a printing contract to D365FO. This will allow an Odata dialog printing contract to be sent to D365FO in response to on an event in D365CE.

Note : There are  two ways to invoke the logic in FO without user-interaction, either using 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 direct OData submit or HTTP method.  Performance is a bit 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. Get the id of the Lasernet Direct OData submit record and  copy the id from the URL. There are several ways to do this. In this example  Power pane Plugin in the browser is used to get Record Id 
  3. Create a new process/workflow for the entity in question. 
  4. If this process is an action and you want to use it in a Business Process Flow, then check "As a Business Process Flow action step".  Set “As an on-demand process”, if required. 
  5. Add the step Lasernet.Unified.Printing.Activities.ODataDirectSubmit.
    • Set “The ID of OData Direct Submit” to the id you found in step 2.
    • Set “Inbound serialized contract (will be returned)” to a JSON object.
       OrgName is currently a requirement in LAC FO, so add it (either hardcode or using arguments). OrgName can be found from Developer Resources area in Under Settings>Customizations. The JSON object will be sent to FO, where it can be used for report mapping and filtering.
  6. 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.

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.

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

     
  4. 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 check "As a Business Process Flow action step".
    Set “As an on-demand process”, if required.
                  
  5. Add the step Lasernet.Unified.Printing.Activities.DirectButton.
    1. Set “The ID passed on from the control” to the controlId you added in step 1.

       
    2. Set “The data which are to be sent” to a json object.
      OrgName is currently a requirement in LAC 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.
       
  6. 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.