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

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

Recommended Posts

Posted (edited)

Hi Guys,

Ive got a table which has got multiple types of data.

In my interface file I allow the user to navigate through the records using scripted buttons (with the parameter next;previous). Some records maybe protected from certain users, so what I would like to do in my navigation script is to skip the records with <>.

I've wrote a script to do this, but Im thinking that I could program this a little bit more elgantly and possibly introduce a recusrsive custom function?

As I'm not too sure on hopw to write a CF, anyone out there that can help/guide me?

I have attached my current navigation script as a pdf for anyone that wishes to see what I've done.

Cheers

navigation.pdf

Edited by Guest
Posted (edited)

It would be more useful if you could provide this in a sample fmp file. You will probably get a little more interest and help on this topic if you do. :)

In any case here is a sample solution you could use that is a bit shorter and more flexible:

Set Variable [ $counter; Value:1 ]

#

If [ Get (ScriptParameter) = "Previous" ]

Loop

Exit Loop If [

GetNthRecord ( RecordAccessNav::ID ; Get(RecordNumber) – $counter ) <> "?" ]

Set Variable [ $counter; Value:$counter + 1 ]

End Loop

Go to Record/Request/Page [ Get(RecordNumber) – $counter ]

#

Else If [ Get (ScriptParameter) = "Next" ]

Loop

Exit Loop If [

GetNthRecord ( RecordAccessNav::ID ; Get(RecordNumber) + $counter ) <> "?" ]

Set Variable [ $counter; Value:$counter + 1 ]

End Loop

Go to Record/Request/Page [ Get(RecordNumber) + $counter ]

End If

Edited by Guest
Posted

Hi Brian,

Thankyou for taking the time out to post a reply. Ive tried your code, obviously with references to my file and the previous button just goes into a loop, the next button doesn't move off the first record. I think you're right I should have uploaded a a file to demonstrate what I am after...I may do that tomorrow if I cant solve it with the foundation that you have laid.

Posted

See the attached file for a working example of what I have shown above. This new example also includes a break from the loop in the event you reach the first or last record.

Use

account: test

password: test

The default account for admin access is still admin with no password.

RecordAccessNav.fp7.zip

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