E9.2 Orchestrator to add inventory adjustment (IA) document

fattal1

Member
Hi,

I am creating small orchestration to check on-hand quantity for specific branch in F41021 and adjust these on-hand to zero using IA document.
I created this simple one. data request to select the items/quantities to adjust, then form request to create the IA document.

problem is that the data request returns around 300 records and form request creates separate document for each returned record.

How can i create the 300 line in a single IA document?

thanks

1697231213431.png
 
You do not need to iterate over the array and create the adjustments one at a time. You can pass the entire array into the grid all at once. You need to match the Data Set Variable Name in the data request to the Grid name in the form request. You should also make the Return Variables the same as the Input variables on the form request.

2023-10-15_18-33-34.png 2023-10-15_18-35-17.png
 
You do not need to iterate over the array and create the adjustments one at a time. You can pass the entire array into the grid all at once. You need to match the Data Set Variable Name in the data request to the Grid name in the form request. You should also make the Return Variables the same as the Input variables on the form request.

View attachment 19844View attachment 19845
Thanks Kevin, It worked great.

One more question if you don't mind. The quantity that i am getting from F41021, I need to multiply by -1 for the IA document.
How to do this?

Thanks

Wael
 
Thanks Kevin, It worked great.

One more question if you don't mind. The quantity that i am getting from F41021, I need to multiply by -1 for the IA document.
How to do this?

Thanks

Wael
I would use grooy to read the json array and update it, use that for the input downstream. There are examples on this site.
 
I would use grooy to read the json array and update it, use that for the input downstream. There are examples on this site.
Thanks Stank,

i have never used groovy , however i may look at examples and get help.

one more questions. is it mandatory to use groovy for to make arithmetic operations on variables?
 
Thanks Kevin, It worked great.

One more question if you don't mind. The quantity that i am getting from F41021, I need to multiply by -1 for the IA document.
How to do this?

Thanks

Wael
The easiest way I can think of is using text substitution. You can put a minus sign and then your input variable in ${}. For example, if qty is your variable then -${qty} would be your input.
 
The easiest way I can think of is using text substitution. You can put a minus sign and then your input variable in ${}. For example, if qty is your variable then -${qty} would be your input.

Sorry Kevin

Where to put this?
 
Sorry Kevin

Where to put this?
It would be right in the Form Request where you map the inputs to the grid columns. In the example below I am converting the short item number from the F41021 to the second item number by adding a / to the start of it, and making the quantity negative by adding a - to the start of the input. 2023-10-16_16-23-52.png
 
Thanks Stank,

i have never used groovy , however i may look at examples and get help.

one more questions. is it mandatory to use groovy for to make arithmetic operations on variables?
I think that math can be done with a BSFN call, groovy works too.
 
In fairness, the popup infobox doesn't BEGIN to suggest you can do things like negative variable by tossing a minus symbol before the text substitution var. This is one of those things you "have to learn by yourself" or see an example and take off with it
Very true and my response was very much intended to be tongue-in-cheek! However, the key thing to remember is that the SetGridCellValue action is just typing a string into field on a JDE form. The form control interprets what is entered and looks after the rest. Text substitution in form requests is handy for all sorts of things from setting QBE values to concatenating strings.
 
It boils down to that orchestrator is a giant text substitution engine isn't it?
 
If you don't know Groovy, there are also some math functions inside of Logic Extensions. But I do like the simplicity of the ideas above. I'll have to try them out next time I'm orchestrating.

1698195291602.png
 
Back
Top