I’m trying to write a function that can be called with a part number and quantity, and get the ATP date back from the ATP service. I’m not sure what I need to fix in my function to get it to return the right answer. Right now, it doesn’t fail, it just always returns an answer of today (when the answer isn’t today).
When I look at how Epicor is calling the service, it looks like it called OnChangePlantWithDS and then OnChangeField (when entering the qty) so I tried to mimic that in the function but I’m doing something wrong.
I’m just calling it from postman right now. I tried putting the site as an input on the function and hardcoding it to make sure but it still gives the same error.
I guess a better question is, how can I actually see the data that is being sent to the service by the function, the same way I can see when I trace the way Epicor is doing it?
If you are calling it from postman and using callcontextclient you need to pass on a CallSettingsHeader / CallContextHeader to set the plant
Alternatively if you are passing it as input (the plant) you’ll have to use a Temporary Session Creator to switch pants server side before making the BO call
There isn’t a place to pass it into the second call, and its an output on the first call, so I’m having a hard time understanding what to do with it. I’ve mapped it to a variable now instead of ignoring it but still not sure what to do with it?
It’s not a record, ATP is the service that is called when you run the Available to Promise screen.
Go into Available to Promise
Select the Part
Type in the Quantity
Epicor hits the ATP service and tells you the date that quantity will be available
I want to do this with a function instead of the ATP screen.
I fully agree I am misunderstanding how this works . . .just having a hard time putting the pieces together.
When I watch what Epicor is doing, I see the ATP date come back as an output on that second service call, so that is the theory I was following when I attempted to build this. But I do see some GetLists scattered in there so that is probably what I am missing. I will try to follow the trace more closely and see if that works.
I’m relying on the first call to populate the ds for the second call because it looks like that is how Epicor is doing it. Its the same dataset in and out on both calls. The first one is supposed to populate all the demand and supply records for that part. I wish I could see what is getting populated in there because that would probably make it really clear why its not working.
When I am watching Epicor do it, the ATP records are empty in the ds going into the first call, and come out populated, so that is why I thought I could do it the same way. Building those records would be a lot of work.