May 16, 201312 yr 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
May 16, 201312 yr Solution 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
May 17, 201312 yr Author Where is OnLayoutLoad? I see OnLayoutKeystroke, OnLayoutEnter, OnLayoutExit? Thanks Thom
May 17, 201312 yr Author 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.
Create an account or sign in to comment