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

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

Recommended Posts

Posted

Hello,

In a script, I am trying to set a local variable as one of the fields of the most recently created record. What script step will get me the most recent record? Every record has a timestamp create field but I don't seem to find any appropriate script step that will get this done.

Could it be as simple as:

:Show All Records

:Sort Records (Decending by timestamp)

:Go to record [First]

:Set Variable [$local; Value:Appropriate field]

Posted

I guess that's why they pay you the big bucks! B)

Is this an efficient way to validate?


Commit Records [skip data validation; No Dialog]

Show All Records

Sort Records [No dialog] (timestamp;decending)

Go to Record [First]

Set Variable[$PartNumCheck; Value:Products::Part Number]

Go to Record [Next]

  Loop

   If[$PartNumCheck = Products::Part Number]

    Show Custom Dialog ["blah blah blah... back to order form"]

    Go to Record [No dialog; Products::Part Number = $PartNumCheck]

    Delete Record [No dialog]

    Close Window

    Exit Script []

   End If

  Go to Record [Next; Exit after last]

 End Loop

The Custom dialog box is purpose for avoiding FM validation.

Posted

That is a great way to validate. I would never have arrived at such a simple method. I could not, however, get your Custom dialog box to work. It's like it was stuck in a loop. If I entered info into the diag box and then tried to leave the unique field, it falsely found an existing record. I'll keep trying to figure it out, but thanks so much. I hope other newbs benefit from it too

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