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

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

Recommended Posts

Posted

Is there an easy way to automatically fill a field with a different field from the previous record? This seemed easy to me, but I am new to this application and have had alot of difficulty figuring out the proper script steps.

In my example, each record has a field "Starting Meter" and "Ending Meter". When a user selects the script, the script should pull the "Ending Meter" field from the previous record, and insert it in the "Starting Meter" field of the current record.

I wrote it <unsuccessfully> as:

Set Field ["Starting Meter"]

Go to Record/Request [Previous]

Go to Field [select/Perform,"Ending Meter"]

Insert from Last Record [select, "Start 5090 Meter"]

Exit Script

I would appreciate any advice on this.

Matt

Posted

Insert from Last Record could be used if you were setting Ending Meter on the current record, but only on that field.

It is a better idea anyway to use a global field to transfer the data between records.

Go to Record/Request/Page [Previous]

Set Field [global, Ending Meter]

Go to Record/Request/Page [Next]

Set Field [starting Meter, global]

You may want to include a Show All Records step before going to the previous record, if there is a chance that the current found set does not contain the desired 'previous' record.

Posted

Well I came up with a little naugty recursion, which isn't endorsed by FM Inc. Since it's likely to blow the stack, but this one is pretty harmless, since it only have two loopings - My goal was to avoid a "littering" the base with yet another global:

If [ IsEmpty ( Get ( ScriptParameter ) ) ]

Go to Record/Request/Page [ Previuos ]

Perform Script [ "New Script"; Parameter: Untitled::Field1 ]

Else

Go to Record/Request/Page [ Next ]

Set Field [ Untitled::Field2; Get ( ScriptParameter ) ]

End If

Unfortunately are you on the previous version so scriptparameters are not possibel.

--sd

This topic is 7298 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.