Display name on form based on choice made for another attribute

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
lueu
Posts: 89
Joined: Tue Mar 07, 2023 11:49 pm

Display name on form based on choice made for another attribute

Post by lueu »

Hi!
I have a form where the user can choose an ID based on the result of a query (dynamic choise determined at runtime by existing query). I would like the associated name for this attriute, found in the same table, to be displayed automaticly on the form when the user have chosen the ID.

Is this possible, and if so, how could this be done?

Hope someone has tried this and would like to share their knowledge :)
PointsWell
Posts: 1460
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Display name on form based on choice made for another attribute

Post by PointsWell »

Do you mean that you have used a text field with choices based on a query?

What you probably want is to use a peer relationship instead. You will have full access to all of the attributes of the related BO and can use the field to either show multiple attributes of the referenced BO in the one field or you can use shortcuts to have the peer field to show the ID selected with another shortcut attribute to show additional attributes.

See
Reference Attributes - glossary
Reference Attributes
Shortcut Glossary
Setting shortcut attributes
lueu
Posts: 89
Joined: Tue Mar 07, 2023 11:49 pm

Re: Display name on form based on choice made for another attribute

Post by lueu »

Yes, I have so far used a text field with a drop down based on a query on the related BO. But I will try doing what you suggest, sounds like a good idea.

Thanks a lot for the tip and the links! :)
lueu
Posts: 89
Joined: Tue Mar 07, 2023 11:49 pm

Re: Display name on form based on choice made for another attribute

Post by lueu »

So, I think I figured out the shortcut path, but I am wondering if I am thinking in the right direction about how to display the correct value in the form based on the ID chosen by the user.. Am I right thinkin I would need a query that fetches the belonging name for the ID chosen? And if so, any tip on how to write this query? It should be something like "FIND the name where the belonging ID is the same at chosen in the form". Does that make sense?
PointsWell
Posts: 1460
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Display name on form based on choice made for another attribute

Post by PointsWell »

lueu wrote: Wed Sep 20, 2023 6:54 am So, I think I figured out the shortcut path, but I am wondering if I am thinking in the right direction about how to display the correct value in the form based on the ID chosen by the user.. Am I right thinkin I would need a query that fetches the belonging name for the ID chosen? And if so, any tip on how to write this query? It should be something like "FIND the name where the belonging ID is the same at chosen in the form". Does that make sense?
Nothing so complicated.

The shortcut field is just the path to the attribute that you want to display.

eg. psPart.Name

Where the attribute that you have put the reference attribute is psPart and the attribute that you want to show on the referenced BO is Name

The online help has videos
lueu
Posts: 89
Joined: Tue Mar 07, 2023 11:49 pm

Re: Display name on form based on choice made for another attribute

Post by lueu »

Thanks for all the help so far! I managed to do the referened attribute and the shortcut so that I can display these in the form. Works like a charm!

My remaining issue is that the ID's the user can pick from should be filtered beforehand, based on the users affiliation. The user should only be able to choose from a selection of ID's, not all of them. This is the reason why I first used a text field with dynamic choises from a query.
How to combine theese, or in another way filter he ID's?
PointsWell
Posts: 1460
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Display name on form based on choice made for another attribute

Post by PointsWell »

lueu wrote: Thu Oct 12, 2023 9:30 am I first used a text field with dynamic choises from a query.
Reuse the query on the filter for the peer attribute.

Look for Filter on the bottom right pane in config tool.
lueu
Posts: 89
Joined: Tue Mar 07, 2023 11:49 pm

Re: Display name on form based on choice made for another attribute

Post by lueu »

Thanks! :)
Post Reply