![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
0 in all the records but the commission value was not set. |
#2
| |||
| |||
|
|
Hello all, Has anyone ever had a issue with FM6.5 skipping records in a mass replace statement? The table I'm working with is not designed very well where each record contains (for instance) invoice #, item1, item2, item3, thru item10 then a grand total which is a calulated field for all 'item' fields, a net total which is grand total minus (ex) item7 and item8, a commission flag and finally a commish field which should be populated by my replace statement. In my commission script I first do a find where comm_flag= (not populated) and grandtotal>0 which returns all commissionable records. Then I call a single step script with a replace statement which acts on the commish field. The calculated value is shown below. If(IsEmpty(Comm_flag) and NetTotal>0, NetTotal*.6, Commish) When I ran this on 1,010 records in the found set there were 28 records skipped for no apparent reason. Inspection of those 28 records show the commission flag to be (now) populated with the commission date of the last run (070430) so I have to assume they were in the found set (this field is populated after the report has been reviewed and posted). The net total is >0 in all the records but the commission value was not set. I have experienced timing issues before where I had to put pauses in a script to compensate for latency. But that is normally when I'm calling external processes. I'm befuddled. |
#3
| |||
| |||
|
|
The Replace command itself can't possibly skip records, so the problem is either the way you are initially finding records or the If statement you're using inside the Replace command. |
#4
| |||
| |||
|
|
Helpful Harry wrote: The Replace command itself can't possibly skip records, so the problem is either the way you are initially finding records or the If statement you're using inside the Replace command. Be sure to read everything else Harry has to say, as he is usually right. But also be aware of possible record locking issues. If other users are in particular records as the replace rolls through them, it will skip those records with no error messages if you have Set Error Capture [On] in your script. |
![]() |
| Thread Tools | |
| Display Modes | |
| |