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

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

Recommended Posts

Posted

I have a very simple startup script.  When I open my database, all the steps run, except one.  All the script steps run perfectly once the database is open and I trip the script manually.  The line that doesn't run on startup is a simple date range find.  I've tried disabling all the other steps except the find, and it still doesn't run on startup.

 

Here's the script:

 

View As [View as Table]

Adjust Window [Maximize]

Set Zoom Level [200%]

Show All Records

Perform Find [Restore]    (Find Records, Court Calendars::Calendar Date: [1/1/2013...12/31/2013])

Sort Records [Restore; No dialog]    (Calendar Date, Ascending Order)

Go to Record/Request/Page [First]

 

I can't understand why that one line refuses to run on startup, yet runs fine when I trip the script manually.  Any ideas?

 

Thanks,

Kevin

Posted

Deselect the "Restore" in the script step and see that does it for you.

Posted

You don't have a go to layout script step in your start-up script, so perhaps you are not on the expected layout when the find is performed.

 

FYI: this type of find is probably more suitable:

Enter Browse Mode
Set Field[Court Calendars::Calendar Date; Date ( 1 ; 1 ; Year ( Get ( CurrentDate ) ) ) & "..." & Date ( 12 ; 31 ; Year ( Get ( CurrentDate ) ) ) ]
Perform Find
Posted

Thanks for the reply, Dan.  I added a Go To Layout as my first script step but it didn't make a difference.

 

I tried your script steps, but I don't understand where the calculation begins.  Does it start with ( 1 ; 1 ; ?   If so, I can't get it to work -- the syntax may be wrong.

 

Thanks,

Kevin

Posted

Here is just the calc:

Date ( 1 ; 1 ; Year ( Get ( CurrentDate ) ) ) & "..." & Date ( 12 ; 31 ; Year ( Get ( CurrentDate ) ) )
Since you are using FileMaker Advanced, you should turn on script debugger before opening the file, then step through the script one step at a time.
Posted

Thanks, Dan.  I'll try your script steps tomorrow when I get to my office.

 

And how stupid of me -- it never dawned on me that I could turn on Script Debugger before opening the file.  I've always used it after the file was already opened.  Duh.

 

Kevin

Posted

Dan, being the impatient person that I am, I VPN'd to my office and ran script debugger.  Sure enough, I found the problem.  It seems that a while ago I had set an OnLayoutEnter script trigger.  It was calling a script that "undid" my startup script's find.  Everything is working well now.  Of course, I will try your script steps tomorrow.  I'm always willing to learn something new.

 

Thanks again,

Kevin

Posted

Hi again, Dan.  I tried your script, but it was leaving me in edit mode within a record, asking if I wanted to save changes.  Depending upon my response, either the date field was left empty or the record was deleted.

 

I changed the "Set Field" to "Set Field By Name" and it works perfectly.  From your calculation, it appears that in 2014 it will display only year 2014 records upon startup?  That would be great.

 

Thanks again,

Kevin

Posted

omg, another mistake in a code snippet! I need to pay more attention when I'm posting.

 

It should be:

 

Enter Find Mode

 

NOT:

 

Enter Browse Mode    // this was incorrect, sorry

 

Set Field vs Set Field by name should not matter.

 

Yes, the script steps would search for records in the current year only.

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