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

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

Recommended Posts

Posted

I have a layout that I want to run a script that will do a find and only return certain records when it is switched too by choosing in the Layout dropdown. I tried using OnRecordLoad but that created a loop I couldn't break out of. My script was.

Set Error Capture[On]

Enter Find Mode[]

Preform Find [Restore]

If[Get(LastError) = 401]

 Exit Script []

End If

Set Error Capture[Off]

 

What I am struggling with is that there will be times that it will return zero records and then my plan was to add a script step to add a new record if that happens but haven't got that far yet.

 

 

Thanks

Thom

 

 

Posted

Try OnLayoutLoad. Hmm. I'd throw a dialog to ask if they want to add a new record.

 

If (get(foundcount)=0

 Show Dialog, "Add New?", "Yes", "No"

  If get(lastmessagechoice) = 1

 Perform Script "Add New"

 Else

 go to original layout

endif

Posted

oops... Should have done a little googling.... Your answer fixed it. Thanks a ton

 

 

from Filemakers website

NOTE: The name of OnLayoutLoad has been changed to OnLayoutEnter in FileMaker Pro 11 to match the OnLayoutExit trigger that has been added.

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