Jump to content
Sign in to follow this  
stefangs

Global value list

Recommended Posts

Hi all,

In my contacts table, I have a check box field where the user can categorize any contact into three categories that are used in several places throughout the solution. So a contact may be in the 'client' or 'personnel' category. Ideally I would end up with three value lists that can be applied anywhere a contact needs to be entered.

For example, when creating an invoice the contacts menu would pop up a list of only those contacts that have the 'client' checkbox set.

I keep running into problems with globals not being indexable or the popup list showing the contact ID along with the name which I don't want. So obviously I'm approaching this wrong.

Thanks for any help,

Stefan

Share this post


Link to post
Share on other sites

Where exactly do you see globals in this situation? The categories of a contact are property of contact, so this certainly cannot be a global field. And if you only ever want to see clients from Invoices, why would you use a global for this?

Now, you could use a global field to select the category for the value list. But then you would have to populate it with "Client" before trying to use the value list from Invoices. OTOH, you would only need one value list, not three - see the attached demo.

GlobalCategoryVL.fmp12

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the demo. This works well, but of course it's not elegant having to select 'client' in a (to the user) unnecessary field before you can select a client.

This is the complicated I tried. This worked sort of, but not when I asked to sort the value list by the second field and not show the first field in the 'Manage ValueLists' dialog.

- Checking a category in the contacts table populates a calculation field with the category ID (I suppose this could also be literal text instead). Say clients are ID 1. So you check 'client', then that field contains 1.

-  A different table has globals for each category. The globals contain ID numbers, like 1=client, 2=staff. Create a relationship from each of these globals to the category field in contacts.

- Create a value list for each category (all work the same, but have a different category).

- Put contact ID field for the required category (e.g. clients) on the layout to popup a list of all clients, but don't show the IDs, only the names.

- Overlay this field with a non-editable field of the client name.

 

Share this post


Link to post
Share on other sites
55 minutes ago, stefangs said:

This works well, but of course it's not elegant having to select 'client' in a (to the user) unnecessary field before you can select a client.

Well, it's a demo. In the real implementation, you can select the type for the user beforehand - e.g.by a script triggered on OnLayoutEnter - and hide this from the user. 

  • Like 1

Share this post


Link to post
Share on other sites

Ah yes, that sounds simple enough. Thanks!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

Sign in to follow this  

×
×
  • Create New...

Important Information

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