E9.2 Unit Price = 0

Stank1964

Well Known Member
I have an ORCH and it contains a forms request using P4210. Sometimes, depending on the sales scenario, we give away products. When that happens, the request comes in with a unit price = 0 for the free item. When the price is mapped to the unit price field on the form, the resulting sales order has the price that is calucated by the system, not the overridden price which we want to be zero - free. Has anybody figured out how to get around this?

Thanks. Stan
 
I tried to go in and do one on our system to see if I could spot where the stuff was happening, but our system isn't set up on the SO side yet. When you manually go thru the exact steps your FR is going through, you type the price at 0 and price override code gets set so it stays there?

If you skip right over the price field, then the base price gets pulled?

If this is all true then a zero value isn't being passed as a valid value to the FR from the Orch Input. This could very well be a deficiency with the tools rather than something you did wrong or could do to fix it. I vaguely remember discussing this at conference or an enhancement review-- let me poke around next chance I get to see if it might already be entered.
 
That’s right, Dave. Overriding the price with a zero entry yields a different result than what we see when ORCH transacts that same thing using a form request.
 
One thing to try would be to add 0 as default value for order qty to the FR (at the lowest level-- when you're inside the FR looking at the form) and run a few tests?
 
I've come to discover that there is a row exit for "zero" price in P4210. That option must be taken to zero the price of a sales order line. Now, how to do that with a forms request where there is no QBE line...
 
Do you have grid filter available? This might be the way! (I had not seen the zero price exit before, good to know!)

1692110328535.png
 
Hmm, my screenshot is from what I believe is that grid-- I wonder which app/form you're looking for it on? I can verify on my end and write up instructions

Also which tools release are you on? I wonder if you might not yet have grid filtering?
 
Hi Dave. Thanks for the help and advice on this. I can see that filter setting, but I am not sure how I would go about using it. In the request, I have the price. The request is intended to add a sales order. Some of the lines might be free based on a zero price in the request. How do suggest that I use that info to trigger the zero price row exit?

Thanks!
 
Someone probably has a better idea based on experience, I'm just thinking of what might work as a "quick fix"

FR #1 - enter all info, even zero price items that go in. Accept the SO. Return the SO # to next step
Script - take orch input array, filter out items that are nonzero, leaving an array of only zero-price items
Rule - check to see if there are any zero-price items. If there are, continue. if not, skip next step
FR #2 - Iterate over zero-only lines, edit the order, go into detail, use the grid filter to find the single line, click the row exit, accept the order. Repeat for all zero-price items
 
So, I can iterate over a json array? If so, I think I can do that.

But, it sounds like we could use the capability to call an ORCH from groovy. That way, groovy can figure out when to call for the zero price update ORCH and call it.
 
Yup, though I believe you need to define it as an output of a script component (or orch input, or data request return) for it to be "seen" as a valid array for downstream iterate.
 
So, to accomplish this, I used a rule, on the rule, I use the iterate over option looking for zero unit priced item(s) in the request. When the unit price is zero, a form request is called passing in the order number and the line number to zero. Some simple forms request instructions get the job done. Good deal.
 
Another alternative approach would be to use the Application Stack Service. This would be an all Custom Request / REST API connector solution. So, if you are comfortable with manipulating JSON using Groovy or Ruby, then it might be worth taking a look. Essentially, you would use the API to open the P4210 and your sales order. When you do that, the service will return information from the screen in JSON (you can specify what fields you want back), and based on the information you get back you can select rows and click your Zero Price row exit. It does take some effort to make it work, and you need to check the responses for errors. However, the upside would be improved performance. First, you would not need to query the sales orders to determine which lines need to be zeroed. The information would be returned from the API as part of opening the order. Second, you would be able to update all of the items on the order in one transaction. If you iterate through a list of lines to change, you will be opening and closing the order on each iteration.

I would suggest trying @DaveWagoner's suggestion and see if the performance is acceptable. If it is, then you are all set. If you cannot get the throughput required, then have a look at the API. Application Stack Service API. Oracle's documentation isn't extremely robust but there is enough to get started.
 
Another alternative approach would be to use the Application Stack Service. This would be an all Custom Request / REST API connector solution. So, if you are comfortable with manipulating JSON using Groovy or Ruby, then it might be worth taking a look. Essentially, you would use the API to open the P4210 and your sales order. When you do that, the service will return information from the screen in JSON (you can specify what fields you want back), and based on the information you get back you can select rows and click your Zero Price row exit. It does take some effort to make it work, and you need to check the responses for errors. However, the upside would be improved performance. First, you would not need to query the sales orders to determine which lines need to be zeroed. The information would be returned from the API as part of opening the order. Second, you would be able to update all of the items on the order in one transaction. If you iterate through a list of lines to change, you will be opening and closing the order on each iteration.

I would suggest trying @DaveWagoner's suggestion and see if the performance is acceptable. If it is, then you are all set. If you cannot get the throughput required, then have a look at the API. Application Stack Service API. Oracle's documentation isn't extremely robust but there is enough to get started.
oooh this looks interesting...
 
Hi Kevin and thank you for the response. I will say that I iterate over the request not a re-inquiry of the resulting sales order. The request is where the zero price is made clear. Once the order is entered in JDE, normal pricing results and which item should be zero cannot be derived based on the JDE order. But, your suggestion about the stack APIs is interesting. Can you elaborate further on what they are and how we can use them?
 
Last edited:
The Application Stack Service is an API on the AIS server. What the appstack service gives you is complete control of an interactive application. Basically, it allows you to dynamically create your form request as you work your way through whatever it is you are trying to accomplish. You access it using a REST connector as a Local AIS Call. Every call goes to the same API, but the json will be different. Generally, the first call you make to API is to open the stack. Then you will perform a number of actions to complete some work, and finally, you will close the stack. The API’s response will tell you what is on the screen, including warnings and errors. You can parse that response in Ruby or Groovy, and dynamically create your next ActionRequest depending what was returned from the previous call.

I use the api whenever the steps in a form request are not repeatable (a sales order with some kit items mixed would be one potential example), require a lot of extra steps to look up information before calling a form request, or if I want to leverage the form to validate my data and give me an opportunity to fix an error. It is important to note that unlike a form request that will throw an orchestration error if the JDE application throws an error, the api will simply return the error. This means you need to be mindful that you are building your own error handling. However, that kind of control can be really helpful.

Here are a couple of examples where I used the API:
A client wanted an orchestration to upload p-card transactions from a flat file provided by their bank into AP vouchers. I used appstack api to load the data into the P0411Z1, and then capture the errors found when the P0411Z1 tried to save. Most of the errors were bad subledgers or gl accounts, and I could “fix” the errors by using default values provided by the business so that the transactions could be saved. Then I could produce an error report of the changes I made. This gave the AP to go back to the source system and fix it. However, if they were coming up on a payment run they could load the vouchers as is, and create journal entries to correct the expense afterwards.

Another client needed to make last minute changes to sales orders (additions, substitutions, deletes) just before they released them for picking based on inventory availability. Normally there would be multiple changes on a single sales order. With the api I was able to open the sales order, retrieve the detail lines, determine what changes were required to the order, create the json to adjust the order, make the change, and save the order once. The client did the first iteration of the orchestration using form requests and it took several hours to process all of their changes. Using the API, we were able to get it under an hour simply because we able to remove a lot of data requests and rules, and incorporate it into a groovy script. When processing hundreds of orders at a time, that kind of overhead really adds up.

The examples in the Oracle documentation give you some basic json that you can use as a template for your own orchestration. Their examples are called from cURL and include a token. You don’t need to worry about the token when calling from a REST Connector.

Normally, I write my open and close stack connectors first. That way I don’t have to worry about a reservation hanging around when I’m creating the rest of the steps. I create orchestration variables for stackId, stateId, and rid. These three values are returned from the api on each call, and need to be passed into the next call.

If you have any additional questions, please let me know.
 
I use the api whenever the steps in a form request are not repeatable (a sales order with some kit items mixed would be one potential example), require a lot of extra steps to look up information before calling a form request, or if I want to leverage the form to validate my data and give me an opportunity to fix an error.
I've naively tried to break a FR up into disparate steps to do exactly this. I really need to find some time to play around with these concepts. Thank you!
 
The Application Stack Service is an API on the AIS server. What the appstack service gives you is complete control of an interactive application. Basically, it allows you to dynamically create your form request as you work your way through whatever it is you are trying to accomplish. You access it using a REST connector as a Local AIS Call. Every call goes to the same API, but the json will be different. Generally, the first call you make to API is to open the stack. Then you will perform a number of actions to complete some work, and finally, you will close the stack. The API’s response will tell you what is on the screen, including warnings and errors. You can parse that response in Ruby or Groovy, and dynamically create your next ActionRequest depending what was returned from the previous call.

I use the api whenever the steps in a form request are not repeatable (a sales order with some kit items mixed would be one potential example), require a lot of extra steps to look up information before calling a form request, or if I want to leverage the form to validate my data and give me an opportunity to fix an error. It is important to note that unlike a form request that will throw an orchestration error if the JDE application throws an error, the api will simply return the error. This means you need to be mindful that you are building your own error handling. However, that kind of control can be really helpful.

Here are a couple of examples where I used the API:
A client wanted an orchestration to upload p-card transactions from a flat file provided by their bank into AP vouchers. I used appstack api to load the data into the P0411Z1, and then capture the errors found when the P0411Z1 tried to save. Most of the errors were bad subledgers or gl accounts, and I could “fix” the errors by using default values provided by the business so that the transactions could be saved. Then I could produce an error report of the changes I made. This gave the AP to go back to the source system and fix it. However, if they were coming up on a payment run they could load the vouchers as is, and create journal entries to correct the expense afterwards.

Another client needed to make last minute changes to sales orders (additions, substitutions, deletes) just before they released them for picking based on inventory availability. Normally there would be multiple changes on a single sales order. With the api I was able to open the sales order, retrieve the detail lines, determine what changes were required to the order, create the json to adjust the order, make the change, and save the order once. The client did the first iteration of the orchestration using form requests and it took several hours to process all of their changes. Using the API, we were able to get it under an hour simply because we able to remove a lot of data requests and rules, and incorporate it into a groovy script. When processing hundreds of orders at a time, that kind of overhead really adds up.

The examples in the Oracle documentation give you some basic json that you can use as a template for your own orchestration. Their examples are called from cURL and include a token. You don’t need to worry about the token when calling from a REST Connector.

Normally, I write my open and close stack connectors first. That way I don’t have to worry about a reservation hanging around when I’m creating the rest of the steps. I create orchestration variables for stackId, stateId, and rid. These three values are returned from the api on each call, and need to be passed into the next call.

If you have any additional questions, please let me know.
Awesome info! Thank you for taking your time to trying to teach me how to fish. Before your post, I didn't even know this kind of fish were even in this lake....
 
Back
Top