Jump to content
Server Maintenance This Week. ×

I need a layout to only show particular records.


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

Recommended Posts

I need a particular layout to only show records that match a certain criteria.

Is there a way to run a script whenever a layout is viewed? That would do the trick.

I am new to FM but I am proficient in SQL and very comfortable with writing various types of code if that helps my options at all.

Any suggestions?

Thanks a bunch.

-wald

Link to comment
Share on other sites

There are a few ways of doing this, but to see the best way I need more information please!

For example you could use a “self relationship” and a portal, or an automatic find set into a script that also goes to that layout. Tell me why, and what you want to do with the information when its shown, and I’ll try to help.

Rigsby

Link to comment
Share on other sites

Hey

The database I am creating is for an artist studio. We manufacture metal art. The database tracks orders and pieces as they are in the production process.

The layout in question is a daily production list. It needs to show all the orders which have a value of "not made" in the order_status field, sorted according to the date the order was placed.

This allows us to make sure we are making orders in a first come first served basis. I obviously also need to filter out all the orders which have already been made.

Thanks for your help Rigsby

-wald

Link to comment
Share on other sites

wald -

You've described a portal, including some of the options. Now you just need to make a couple more choices and go build the thing. It sounds like you only need a script if you want to keep this portal out of view and automate the actions needed to view it.

To build the portal:

Define a global field "g_Undone", text, and enter the value "not done".

Define a relationship, g_Undone x order_status. (Define it in the file where the portal will display; this can be in the same file as the orders or another file.) Check the box for "Sort related records" and specify the order date field, ascending order.

Finally, draw your portal and add the appropriate fields.

There are options to how you do this. If the global field can be changed by the user, the contents of the portal can be made to change, thus displaying other subsets of records as desired. If you use a "1" instead of "not made", you'll conserve disk space. And so on.

If you would rather not view the records in a portal, you could use the same relationship as above plus a "go to related records" step, in which case the sorting would have to be handled by a script.

Link to comment
Share on other sites

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