I have been setting up some data links using the ERP REST Api to create PO’s and PO Lines. This is part of a PO Requisition workflow and working nicely. But the next thing I wanted to do was set the GLCode.
I have created the entry in the CallDefinitions.json file and I am using a PATCH Request and I can test it fine, but becuase it is a Patch request the PONum, Line, Rel, and COA are in the URL.
So the question is, how do I pass the parameters into the URL? Below show the entry for this particular request as you can see at the moment I have entered some specific values but these need to be replaced with parameters.
I’ve done a lot of work with the datalinks from within the ECM UI, but I’m not familiar with the method you are describing. I know there is an ‘add on’ that I can get from Epicor that allows us to write our own custom Datalinks - is that what you are using?
I’m sorry that I can’t be of more help. And I do not know of anyone here who has/uses it currently.
I know that I, @gpayne, and a few others would absolutely LOVE to see this in action. Perhaps you might consider posting a quick walk-through write-up with a few screen shots?
EPICOR provided a WebDatalink dll that enable us to make the REST API calls. Happy to share some more details, I will put something together. It does work really well, it’s just that in this scenario it has fallen short. I have asked them the question also and I am waiting for a response I am hoping that it is just a case of them further educating me. The issue is that this is not documented so only learned by training from the ECM Consultant.
Cool - we talked to them about this at Insights this year, but no one else has pulled the trigger yet. Anything you can do would be helpful - thanks!
@steveh So back to your original question. Are the parameters in the workflow being passed to the json and then the url and you need to set them to real values rather than hardcoded?
You can do a normal sql datalink to get the data from Epicor and set the values.
Another approach and why I want the rest dll is to be able to change data in a bpm and send it back to ECM. You could update the GLCode in Epicor and send it back.
Can you call the method GetNewPORelTGLC instead and pass the data in the json with this utility?
Well yes. The question here was because for this particular issue I was using a Patch request which involved parameters in the URL I cannot work out how to pass a parameter in this way. I could however pass the whole URL as a parameter so solution number one in this case was to create a field group and use a standard SQL Datalink to build the url for each release and then pass the URL into the REST request. This works perfectly. That said, and given that I have in the end had to do this extra SQL Lookup, I could just get the sysrowID’s for each line and use UpdateEXT as a POST instead which would also solve the problem.
So ideally it would be good to know if I could pass in parameters to the URL but due to the versatility of the toolset I have bee able to work around it.
It is good that it has a way around, but you might get more rest centric answers if you reposted as a rest issue and not in the ECM category. I can’t imagine there are not people here who know the answer.