Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7998 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I would like to do a running inventory database. It would be helpful to advance the (calculated) current item's inventory balance from the "Onhand" field (x) to a balance forward field (y) that is used by the "Onhand" calculation along with credit and debit information when duplicating the record.

Balance + Credit - Debit = Onhand

When duplicating, I am using a script that dups, sets fields to 0 and I need to auto enter the old Onhand amount into the new Balance field. I have tried "Insert from last record" step without success. Any help.

Posted

Make a Balance Global field, gBalance. In your dupe script, add a Set Field command before the dupe step that will set this global field with the contents of the Onhand field (of the old, as-yet unduplicated record).

Then the script dupes & sets to zero as you outlined.

Finally, add another Set Field command that will set the Balance field (of the new duped record, assuming this record is the active record at this moment) with the contents of the global. You could neaten up by setting the global itself to "" as a final step, but if you are careful about using this field, it shouldn't matter.

You could leave your global field stashed on some working layout, an All Fields layout, so it isn't visible during your work. The Set Field command does not need to have the fields available in the current layout to work (unlike Replace).

Steve Brown

This topic is 7998 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.