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?
If so:
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.
@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.
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.
Not sure if you tried but I’ve been testing API in ECM and by putting parameters in the Data Link, I’m able to reference them in the URL like that and it works
For datalinks, there are typically one of two main methods for extracting data using the REST API: 1) The URL has the specific parameters which are required 2) The URL has a filter which allows you to declare the parameters you want to use.
Specific Parameters
“Name”: “BuyerLookUp”,
“Url”: “/api/v1/Erp.BO.POSvc/POes(‘@Company’,@PONum)”
This allows you to dynamically populate the inputs (Company and PONum) to extract the outputs you choose. The outputs available are found in the schema for the REST API call you use.
It may well be included now, I think we were quite early adopters of this.
We were supplied it by the consultant who helped with our install.
If you don’t have the necessary files, perhaps try requesting it via support?
You’re correct in saying it is built in in the later versions of ECM. In the last screenshot you can see the “JSON Web Service” which removes the need for the .dll to be on any machine.
The example they stub in was not helpful to me, but @utaylor got me going and I have this below for sending parameters to a baq and getting back results.