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
Display name on form based on choice made for another attribute
-
- Posts: 1460
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: Display name on form based on choice made for another attribute
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
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
Re: Display name on form based on choice made for another attribute
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!
Thanks a lot for the tip and the links!
Re: Display name on form based on choice made for another attribute
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?
-
- Posts: 1460
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: Display name on form based on choice made for another attribute
Nothing so complicated.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?
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
Re: Display name on form based on choice made for another attribute
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?
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?
-
- Posts: 1460
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya