Ah, thanks for the reply. Is there a way around this to map the button click to trigger the data directive? (i.e. using the ‘on-click’ event for the button In App Studio).
I wanted to use a data directive to generate the report as there is an ‘Auto Print’ action available in the Data Directive designer, which is not in Method Directives.
Note: You will need to ensure the combination of the Key 1 – Key 5 create a unique combination in order for a new row to be generated in the UD02 table. - There is probably a better way like calling GetaNewUD02 then passing in the dataset then calling the update.
Thereafter you should be able to use a data directive on the UD02 table.
In-Trans
Conditions where “row added” to the UD02 table then enable post directive.
Standard
Conditions where enabled from your in-trans directive then your a auto print widget.
Option 2: Calling the report svc to submit via task agent (In this example I’ve done it with the Job Traveller)
I created a re-usable function to retrieve the client workstation (clientcomputer name + username) then pass this variable into a TransView.WorkstationID filed in the row update.
Thereafter it was just a mapping exercise to populate the dataset in method parameters (These essentially will be relatively similar to the parameters in you auto print configuration widget but for the quote report). – You will be able to test this via the Rest API Helper
Personally, I would opt for option 2, as there are back-end triggers that update certain fields, for example Rpt.JobTravSvc when executed will update the last printed field.
Sorry to dig up an old thread. I am new to functions, and struggling to figure out how to grab the output of the AgentID and pass it to the row-update.
Would this need to be in the Response Parameters of the function, and use actionResult.“MyFunctionOutputName” as the pass to the row-update? If correct, the confusing part is that I have never done a response parameter with much success.
For retrieving for the result from the function you shouldn’t need to parse a response, you should just be able to add the following expression “{returnObj.YourFunctonOutputField}” to the expression field in your row update editor.
Please find screenshot below as a quick visual example regarding parsing the response from a rest-erp widget using the rest helper to get an idea of mapping the returned dataset from the rest call to a data view.
After updating the WorkstationID from the function, I try to map the JobTrav JSON. However, I still have no luck getting a preview to launch from the SubmitToAgent.
Is there an extra step to get the preview to launch? Or am I simply mapping the JSON improperly.