E9.1 Store values for later F4201\F4211 update.

FrankCLT

Well Known Member
Hello All,

I have a scenario where we have an SD\OD process that when the Purchasing department makes a cost change to the OD cost, and it's over the standard cost by a certain percent, we are updating the F4211's corresponding SD UPRC according to another metric and order totals on the F4201. And as you guessed it has many bugs of when it updates. My goal is to update the F4211\F4201 only once on the OK button as opposed to every time the cost changes on the grid line.

I would like to keep track of the changes and do it on the OK button click instead of the grid exit. Issue I'm having is keeping track of the grid lines as the user makes changes to the cost. I would only need to keep track of the changes higher or lower than the standard cost.

I realize it's a look of info, but how would one approach something like this. Any feedback would be greatly appreciated.

Thank you,
FrankkCLT
 
We're talking about spinning up your own cache more or less here I think. I've never been a BF programmer so my advice is based on ER/table functionality

You could go with a new workfile with standard detail keys but an additional one that represents the transaction ID, perhaps you could get the transaction ID from the MBF cache operations that are flinging around when inside a SO, or spin up your own based on user/date/time during the init form event. Only write or update the workfile when the update meets your conditions. Then on OK, select...fetch next against the workfile and do your corresponding updates. Finally you'd want to clean up your workfile (maybe? looking for a audit trail with retention?) by deleting according to the keys

Since you're on E91 a logic extension is out of the question, that would be a fun application
 
I've thought about a work file, I have done basic JDE C function programming, but not played with cache. Too bad you can't create arrays in standard event rules, or can you? For any changed grid row line an entry or update in the corresponding array. When the OK is clicked, read through the array and update the F4211 via a BSFN or some other means....
 
I've thought about a work file, I have done basic JDE C function programming, but not played with cache. Too bad you can't create arrays in standard event rules, or can you? For any changed grid row line an entry or update in the corresponding array. When the OK is clicked, read through the array and update the F4211 via a BSFN or some other means....
I was trying to wrack my brain on the array variable creation thing. You could probably get really fancy with delimiting a string var, or a series of string vars, to approximate a multivar array. It would be a bit of a shoehorn when a perfectly good workfile would do :D
 
Funny you say that... I have used a StingVar for just that task.

So, when writing to a work file, would you use the Add or Update Grid Rec to DB with the Suppress Add\Update to your work file?
 
You do need to handle the insert/update of the workfile based on if the key exists don't you... so we're now talking a select against the workfile and the keys, and if the rec exists then a simple io update, if the rec doesn't exist then a simple io insert

I would just attach that as well as your math logic (as a NER just in case) at the grid row changed event personally. I don't think you need to worry about suppress add right? because you want the user-entered detail lines to go in however they are at order entry?
 
Back
Top