Epicor 9.05.702A Populate Number01 field with value

I would like to have the Production Standard (ECOOpr.ProdStandard) populate ECOOpr.Number01 field and store the value until it is changed. In other words, our production standard hours are currently .50 Hours/Piece. When someone changes the .50 to .65 i would want to know that it was .50 previously. So ECOOpr.Number01 would = .50 and ECOOpr.ProdStandard would = .65. I can then show that it was changed from .50 to .65 on a report. And this should have the ability to continue, say next year it is determined that .65 is not enough and it is changed to .75. The ECOOpr.Number01 field would then house the previous value which would now be .65.

I havenā€™t looked in E905, but, you may be able to enable a Change Log on this table in Business Activity Management so that the system will automatically log changes to a field. Change logs have their own built in report as well.

But, dusting off my really rusty ABL knowledge I think this might work :sweat: (there is probably a more optimal way to accomplish it too)

In-transaction data directive on ECOOpr.

CONDITIONS:
there is at least one updated row in the ttECOOpr table
and the ttECOOpr.ProdStandard field has been changed from any to any

ACTION:
synchronously execute ABL define variable dtemp as decimal initial ā€¦ record nothing


Where the query is:
define variable dtemp as decimal initial 0.0 no-undo.

for first ttECOOpr where ttECOOpr.RowMod = ā€˜ā€™.
assign dtemp = ttECOOpr.ProdStandard.
end.

for first ttECOOpr where ttECOOpr.RowMod=ā€˜Uā€™.
assign ttECOOpr.Number01 = dtemp.
end.

Thanks for the reply. I tried the code and wasnā€™t getting anything to update, so i changed it slightly (only one letter after the first RowMod) and it did update the ECOOpr.Number01 field.
However, it changes to the same value as the current ECOOpr.ProdStandard. i was hoping that it would keep the previous value in order to be able to look at a report and see the current value versus what is was before change. Again thanks for your efforts, iā€™m closer than i was before.

define variable dtemp as decimal initial 0.0 no-undo.

for first ttECOOpr where ttECOOpr.RowMod = ā€˜Uā€™.
assign dtemp = ttECOOpr.ProdStandard.
end.

for first ttECOOpr where ttECOOpr.RowMod = ā€˜Uā€™.
assign ttECOOpr.Number01 = dtemp.
end.

Looks like where you are first grabbing the temp var, you are grabbing it
from the temptable (TT) which would be the current value your are setting
(as opposed to the actual value). Canā€™t tell you how to do it in ABL but
the solution should be to grab that var from the actual table, not temp
table

You would need to query for the original value

For First ECOOpr fields ( ProdStandard ) where ttECOOpr.SysRowID = ECOOpr.SysRowID.

            If ttECOOpr.ProdStandard <> ECOOpr.ProdStandard then
                            ttECOOpr.Number01 = ECOOpr.ProdStandard.

End.

If you did this in a BAM, you could get the change log for each value change and store the latest in Number01.

when rowmod =ā€™ā€™ thatā€™s the ā€œbefore the proposed changeā€ version of the row so hitting the actual table shouldnā€™t be necessary (in general) if the directive is pre-processing or in-transaction. Obviously that isnā€™t working here :confused: accessing the actual record would definitely be the next best option.

Should he put a message on RowMod to see what it is coming thru as before resorting to a second read?

Nathan,

I didnā€™t know that - I learn something new about Epicor every week! Does that apply in E10 as well?

With all that said, he may have had a typo and used ā€˜Uā€™ in both cases

Iā€™ve used BAM in the past to record a change which documents it in the log. Are you then suggesting to query or sub string the log file?

No. If you make a .p file for the bam you can do any abl you want, so the update to Number01 could be done in the bam and you have the OldECOOpr record to compare to.

When I was first starting with Epicor I found a bunch of BAM examples from 2003-5 that made new tasks, new material queue records or updated jobs.

I would post a link to the file since I canā€™t post the file, but I canā€™t find them anywhere on the site.

Very interesting indeed! I found some info on the net relating to the BAM .p files. Do you recall if these have to be triggered to ā€˜Send Alertsā€™?

That is how Iā€™ve triggered them.
Canā€™t find it now, I thought I used to have an example of calling .p from a BPM too, maybe just too late in the day, my imagination.

Also there used to be example .p programs included on the server in V8 / E9
Here maybe ā€¦/server/ud/test/

You need to have send alerts checked for the routine to run, but you can set sendemail = false to suppress the email.

As Bruce said, look in your server/ud/samples directory. I found the ones I referenced and some more in there.

I think you may find that BAMs are depricated in 10, can anyone confirm? If they are then you may want to steer away from them.

That being said those example programs are nice, and have used the BAM .p method to perform some alerting around quote approval limits.

Yes, BAMs were folded into the BPM process in 10.0.

Mark W.

Thanks everyone for sharing info with me. I really appreciate it! I was able to meet my objective in utilizing two BPMā€™s and also by creating field mappings.

  1. Record when ECOOpr.ProdStandard has changed: Pre-Processing BPM on EngWorkBench.Update
    CONDITION: the ttECOOpr.ProdStandard field has been changed from any to any
    ACTIONS: set the ECOOpr.Date01 field of the updated row to the TODAY expression
  2. Get value of ECOOpr.ProdStandard when opening/checking out part: Post-Processing BPM on EngWorkBench.GetDatasetForTree
    CONDITION: leave blank
    ACTIONS; set the ECOOpr.Number01 field of all rows to the ttECOOpr.ProdStandardā€¦ expression (this assigns the value), It will get passed to the UD Number01 once the part is saved.
    3)The values from steps 1 & 2 will now be int he UD fields. However, if the part is checked out again, the UD values go back to zero! Utilize: System Mgmnt, Utilities, Custom Field Map to set the values in related tables ECOOpr.Number01=PartOpr.Number01 (also Date01), PartOpr.Number01=ECOOpr.Number01 (also Date01). Do this for JobOper as well. It appears to be working!
1 Like