Jump to content
Salesforce and other SMB Solutions are coming soon. ×

How to build direct-select buttons?


new2fmp
 Share

Recommended Posts

I hope this is an easy question for somone but it has me stumped. I have a very simple database with TableMain and TableA. There are 10 records in TableMain, one for each of 10 regions and records in TableA are related to TableMain by RegionID. I have a Main Layout (based on TableMain) that uses a portal to show all TableA records for one of the regions. I run my application without the user seeing the Status Area, so I want to have 10 buttons down the left side of the layout so the user can select one of the regions directly to view it's TableA entries. The button action is easy in that button 4 just causes the portal to display records related to the 4th TableMain record and so on. The hard part is that on each button I want to have the name of the region's current office manager which is a field in TableMain. The managers can change which is why it is a modifiable field but it does not have to be edited on the button since it can be edited elsewhere.

 

Here is my question: How can I display the MainTable:ManagerName on the buttons? If I put them in a repeating field I could do it with Field Control/Setup = "n of 10" but that would make it hard to display and edit them on the Main Layout. Should I pull them out into a special table just for this one feature?

 

Thanks for any help on this.

Link to comment
Share on other sites

Infosar as it sounds like your ten regions constitute a pretty static data set (i.e., you aren't going to have one or two of them disappear and three different ones come into use by next year or anything like that), you could define 10 constants (calc fields with hardwired values equal to the Region ID of each record in Region) and then make a selfjoin of each constant to the Region ID field — that gives you ten new table occurrences, you can name them after the Region that they tie to — then ten calc fields that each, in turn, utilizes a different one of those ten rels to reference the Region Manager field which is a field in the Region table, right?

 

Those calcs will reconcile properly and you can use them to label your ten buttons.

Link to comment
Share on other sites

Hello AHunter3.

 

I made my example simple but what I am looking for is a general capability because I have other uses in mind. I guess the general question is: Is there a way to display a TableMain:Field from each of 10 consecutive records down the left side of a layout when that layout is set to Show Records From TableMain?

Link to comment
Share on other sites

Oh!

 

That's even easier. Define a field, named "One", calc, numerical, = 1

 

Make a selfjoin relationship of the table to itself, a One to One relationship if you will :)

 

Pop a portal to that TO on any TableMain layout and you should get a vertical, optionally scrollable list of TableMain records, showing 10 or any other number of portal rows as you see fit.

Link to comment
Share on other sites

That did it! I just did a Button Setup with Go To Record By Calculation and used Get(PortalRowNumber) and it works like a charm. This should be very useful in several areas of my application. (BTW, "one to one relationship" was a good one)

 

Thank you very much for your help.

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use