June 24, 200619 yr 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 June 24, 200619 yr by Guest
June 26, 200619 yr 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 June 26, 200619 yr by Guest
June 26, 200619 yr 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.
June 26, 200619 yr 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
Create an account or sign in to comment