Calling a Data Directive form application studio

Hey there epicor world!

I was running into some trouble recently with app studio, hoping someone could help me out. I have been trying to run a sales order acknowledgement report after clicking on a button in application studio recently and am having trouble figuring out a way to pass the dataset I need to some UD fields that I reference later. The button press on click runs the UD05.UpdateExt rest service which wasn’t my first guess but makes sense after reading this post from a little bit ago
https://www.epiusers.help/t/button-to-auto-print-ssrs-report-via-data-directive/91765

I am trying to call a data directive just because I need the ability to run an auto print, so in order to do so I followed the first example in the post above where I call the Ice.BO.UD05Svc service and the UpdateExt Service Operation. Next in the dataset I pass in the JSON editor is the company as company, and OrderHed.OrderNum as Key1. Then in my BPM I check to see if the field is updated in-transaction, then I run the Standard directive and run the OrderAck report (Even though it doesnt have the UD05 table I am using to pass data which I think is where I am going wrong since this BPM might not be able to print this report?) with parameters that ssrs is disabled right now for testing and we are print previewing a specific order number.

image

image
image

So after doing all this, I click my button and keep getting the error: Parameter continueProcessingOnError is not found in the input object, which I think is basically saying the rest - kinetic event isn’t working? So yeah, I have been slamming my keyboard at this for a few days now and figured I’d ask here to see if anyone could share some insight. I feel like I am missing some understanding because I am on multi-tenant and don’t have access to the rest API directly, but I am not sure. Here is the error code I get when looking at the tracing options on the web after clicking my button:

image

Any help is appreciated, thanks!

UpdateExt takes in a different dataset than Update.

If you open up UD05.UpdateExt in swagger, you can see the expected input dataset.
image

3 Likes

I would strongly consider writing a function to do this. Then you can call the function directly vs needing to do an update to the record.

3 Likes

I got to look more into this since I am not familiar with swagger but I will check that out.

That was my first thought as well, but all I could find was people saying that I can’t call a data directive from a function so how would I got about doing that?

Create a separate function to handle the print logic. This will give you flexibility to call it from BPMs, Data Directives, or even App Studio as needed.

That said, you likely don’t need to call it from a Data Directive. Data Directives are triggered when data is being saved to the database; which may not be needed here just to print.

1 Like

You can call a DataDir from a func, but only in the sense that you can write to a BO table which would trigger it.

The more direct approach would be to write the func to generate the report, but that’s a bit more involved.

3 Likes

https://www.epiusers.help/t/lets-share-useful-functions-sharing-is-caring/100371/19

This may help

I ended up triggering the data directive after a save by calling the same event that saves the document whenever my button is pressed, so that works pretty well but I am going to review as much of this as I can to learn more about other options. Thanks, I appreciate the help!