Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Go To Previous Record Button scripting


Jason Meikrantz
 Share

Recommended Posts

I am looking to place a button in my database which allows me to go back one record at a time while in browse mode. I cannot figure out the proper scripting for this button. Any help would be appreciated. Thanks

Link to comment
Share on other sites

This usally include 4 buttons

 

First BTN= Go to Record Request [First]

Back BTN= Go to Record Request [Previous]

Ahead BTN= Go to Record Request [Next]

Last BTN = Go to Record Request [Last]

Link to comment
Share on other sites

You could make a script which does something like this...

 

If["Status( CurrentRecordNumber) = Status( CurrentFoundCount)"]

If["Status( CurrentFoundCount) = 1"]

Show Message["There is only 1 record in the found set."]

Else

Show Message["You have reached the end of the found set and are going back to the first record.

"]

Go to Record/Request/Page [First]

End If

Else

Go to Record/Request/Page [Next]

End If

 

You could do the same thing for stepping backwards using Go to.. [Last] and Go to .. [Previous] (change your messages accordingly if you decide to keep (put in) messages)

Link to comment
Share on other sites

Hi Jason,

There should be no need for a script to make your button that goes back one record in browse mode. You could simply attach your button directly to the Go To Record/Request/Page command and select the option for 'Previous'. cool.gif

Link to comment
Share on other sites

Although typically not necessary, scripts can add some useful functionality to navigation.

 

One advantage of a script is that you can cycle continuously through the records where the Next and Previous buttons described by Chopper and Colbalt Sky will stop at the end of the found set.

 

I have also used a script to step through records so that a specific layout is presented depending on the record data.

Link to comment
Share on other sites

You are correct Doug. The use of a script to step through records provides many flexibilities which do not exist with the simple, unscripted command.

 

I also add a message to the script which produces a dialogue when one reaches the first or last records as I have often seen people sit and continue to click the button and wonder why it wasn't working when they were actually at the first or last found record.

 

By scripting, one can also "gray out" the button when the first or last record is reached. So a lot of neat things can be accomplished with scripts when navigating.

 

Tom laugh.gif

Link to comment
Share on other sites

Hi Jason,

 

I have emailed you a file which has some really neat back/forward button scripts and graphics.

 

It is entirely open so you can import scripts and copy calcs to your db if you wish.

 

Be well . . .

 

Tom

Link to comment
Share on other sites

although this is not directly relevant to your question but you may find it useful. There was a topic about scripting that allows user to 'go back to previous page' similar to that of a web browser.

 

you can find it at www.fmforums.com under scripting

Link to comment
Share on other sites

  • 4 years later...

Doug or anyone,

This post goes back a few years, and provides a navigation script that it tells the user that they have reached the first or last record. I am having difficulty implementing the script (attached at the end).

 

I define the script as follows:

 

In ScriptMaker...

Go to Record/Request/Page [by Calculation]

I then enter the following script as the calculation.

 

When I hit OK, FM highlights the first "IF" and indicates that "The specified table cannot be found."

 

I can't see where or how I am supposed to specify a table.

 

Any suggestions?

 

JDH

 

 

You could make a script which does something like this...

 

If["Status( CurrentRecordNumber) = Status( CurrentFoundCount)"]

 

If["Status( CurrentFoundCount) = 1"]

Show Message["There is only 1 record in the found set."]

 

Else

Show Message["You have reached the end of the found set and are going back to the first record.

"]

Go to Record/Request/Page [First]

End If

 

Else

Go to Record/Request/Page [Next]

End If

 

You could do the same thing for stepping backwards using Go to.. [Last] and Go to .. [Previous] (change your messages accordingly if you decide to keep (put in) messages)

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use