Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Scripting to avoid access to unauthorised records

Featured Replies

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

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

  • Author

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.

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

  • Author

Thanks Brian C,

Thats perfect.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.