Jump to content

Button to sort by open or closed status


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

Recommended Posts

  • Newbies

Very new to FM and the whole scripting process.

Is it possible to create a script that will create a list based upon the status of a radio buttons value list. I am trying to track a database based upon a job being open or closed. I will create two buttons, one to view open jobs, one to view closed jobs and one to view all jobs.

The way I have it set up so far is a radio button field named "JobStatus" using a value list named "Status". Status only has an "Open" or "Closed" state with the initial state set to "Open" when a new record is created.

Any help would be greatly appreciated. I have been going through quite a series of system beeps trying to figure this out.

Thanks,

Jay

Link to comment
Share on other sites

isn't it funny, I did a similar system just minutes ago.

You need a global field to hold the users selection, format it as check boxes based on a value list, make the values "open" and "closed". I call the global field gSelection.

Make a script to generate the list. The script needs a conditional IF statement to work out what records to find, or put another way, what find to perform.

Make a script that performs the find for open record: call it "Find Open Records" and another to find closed records.

Now to the logic... if the user selects both open and closed check boxes the gSelect field will have one

Link to comment
Share on other sites

Not sure what you mean. The gSelect field has check boxes that let the user select whether to find open or closed records (or both if both are checked). This could be changed into radio buttons if desires i guess, but you'd need three (open, closed, all) and I liked the check box interface better.

If you're asking whether you need a script to do it, the answer is yes. It's a complicated process.

Link to comment
Share on other sites

"I will create two buttons, one to view open jobs, one to view closed jobs and one to view all jobs."

From this I assumed you wanted to perform finds to display open, closed, or all records, not just sort the list. If that's what you want then the process I outlined will work.

If you just want to sort the records, the process is much simpler. Use the Sort command to sort the records. Then define a script with the Sort [restore, no dialog] script step in it (a one-line script is all that's required). The "restore" option makes the script save the sort order and restore it each time the script runs.

Link to comment
Share on other sites

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