I don’t know if this is possible but I have a standard 850 map that I am able to use with all of our trading partners. I am using the SQL connector to return the data of a simple Header/Detail table relationship. Up until now, the data from the Detail table has always been sufficient for all of our current connections, but I have a new connection i’m setting up and they require additional data.
Currently, I am creating POLoop1 > PO1and sending the following: PO101 linenumber PO102 Quantity PO103 Identifier (EA) PO104 Price PO105 (empty) PO106 Identifier (N4) PO107 UniqueID
This new setup requires PID (which I have added) but they only need PID05 (item description).
My question is: Is is possible to add some arc script within my loop where I can call a SQL stored proc and pass it the value of PO107 and map the result to PID05?
Thanks
Page 1 / 1
UPDATE: I did make some progress. I added a script inside the PO1Loop1
However, it returns the result for the first procedure call for all PID05 elements. I suppose this code needs expanded to loop over each UNIQUEID?
Any ideas would be appreciated.
Hi Eric,
The best designer-driven way to approach this is to leverage a feature that was added in the most recent quarterly update to CData Arc 2023 at https://arc.cdata.com/support/builds/ which now includes a new Lookup Stored Procedure action in the SQL connector:
This was recently added, but it’s a nice designer driven way to enrich an existing XML document with values that would be returned from the lookup to a stored procedure.
With that said, the way that you are doing this now will also work just as well - you can use code script to execute the stored procedure call as you are looping over each element of the Detail table.
As long as you are entering the code block for the dbCall operation within the Foreach Detail so that:
You are issuing that call n times for each detail and
xpath(UNIQUEID)] is giving you a unique value for each detail
That should work just fine.
I see that you are storing the return in the _map item, but if you’re doing no further manipulation with that variable, you could also use a custom script in PO105 and set the value in result.text, like this: