Dropdown linked to another dropdown

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
JordanMaxim
Posts: 8
Joined: Sun May 28, 2017 10:03 pm
Location: Rotorua, New Zealand
Contact:

Dropdown linked to another dropdown

Post by JordanMaxim »

Hi,

I am new to AwareIM. I apologise if this question has already been answered. I have spent hours searching previous forum post on this question but could not find the answer.

I have 2 dropdowns in my BO (Request Type & Change Type) the Change Type options / results are based on what is selected in the Request Type. Change Type has dynamic choices set which is linked through to a Query. The Query then has a Where clause based on the results of the Request Type dropdown.

Below is the Query Rule, CST05_SupportTickets is the record I am updating and BO_CST05_ChangeType is the record I am looking up.

FIND BO_CST05_ChangeType WHERE BO_CST05_ChangeType.RequestType=CST05_SupportTickets.CST05_RequestType

The CST05_SupportTickets is a Microsoft SQL Express 2016 External Tables, BO_CST05_ChangeType is an AwareIM table, they are not referenced tables.

I have tried turning on the "Save form when selection changes" option on the Request Type attribute, but this just saves the form, clears all the attributes and opens a new record. I don't mind if it saves the record but I would want it to remain on the record so the user can keep completing the remainder of the attributes.

AwareIM Version 7.1 (Build 2240)
Microsoft SQL Express 2016

I thank you in advance for any help that you can offer.
Regards
Jordan
pureist
Posts: 427
Joined: Sun Jan 24, 2016 10:00 pm

Re: Dropdown linked to another dropdown

Post by pureist »

"but this just saves the form, clears all the attributes and opens a new record"

Sounds like there is now a bug with this option. It used to just save the form as you would expect. There's zero point in clearing the form.

There is a video tutorial on the Aware YouTube Channel about achieving what you want.

I think there is a bug with queries with dynamic choices not accepting/working with dynamic criteria.

I think they both need to be Reference Attributes.

Refer the following Post and Topic:
http://www.awareim.com/forum/viewtopic. ... 365#p37365

There is a Post a few before that one which has an image inset in which the fields are orange.
If that appears to be what you want I can send you the finished bsv.
In that case it is filtering States based on thr Region selected.
JordanMaxim
Posts: 8
Joined: Sun May 28, 2017 10:03 pm
Location: Rotorua, New Zealand
Contact:

Re: Dropdown linked to another dropdown

Post by JordanMaxim »

Thanks for the prompt reply @pureist

Unfortunately I can't follow the youtube video "Implementing Cascading Drop Downs in Aware IM" and can't follow the post you have linked as they both rely on referenced attributes.. My table / bo that is holding the results of the dropdown is an External Database Table, so I can't create referenced attributes.

Unless i'm missing something.

Thanks
Jordan
PointsWell
Posts: 1458
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Dropdown linked to another dropdown

Post by PointsWell »

Is there a benefit to using dynamic plain text drop downs?

I've tended to avoid them for no other reason than all of my reference data is coded numerically for sorting and processing which (I assumed) requires there to be relationship chains via reference BOs. This is an assumption and is based on coming from a strict SQL background.
pureist
Posts: 427
Joined: Sun Jan 24, 2016 10:00 pm

Re: Dropdown linked to another dropdown

Post by pureist »

In continuing to explore this, the only thing you might be missing is the bottom line of the linked Post:
Issue:
When a Plain Text Attribute has Choices which are determined by a Query (Existing or Custom) the query will return zero records (and thus the dropdown will have no items) IF the query contains dynamic criteria obtained at runtime.
..
..
Work Around (when needing query to obtain dynamic criteria at runtime):
Use Reference Attribute's is set to display as a dropdown, as, per Support:
"Dynamic choices were never supposed to work like that [for Plain Text Attributes]."


In other words, if a Reference relationship is not possible with an External Table, then you can't achieve what you want the way you want! (unless I'm missing something)

You might have use a popup via PICK.

JordanMaxim wrote:Thanks for the prompt reply @pureist
Unfortunately I can't follow the youtube video "Implementing Cascading Drop Downs in Aware IM" and can't follow the post you have linked as they both rely on referenced attributes.. My table / bo that is holding the results of the dropdown is an External Database Table, so I can't create referenced attributes.
Unless i'm missing something.
Thanks
Jordan
JordanMaxim
Posts: 8
Joined: Sun May 28, 2017 10:03 pm
Location: Rotorua, New Zealand
Contact:

Re: Dropdown linked to another dropdown

Post by JordanMaxim »

Hi,

Thought I better give an update incase anyone comes across this in future.
I have phoned Vladimir and we have found a solution.

I am now using a process to first create the record and then view the record.
By doing it this way the "Save form when selection changes" option on the first plain text / dropdown attribute works as it has a record to update.

Now when the dropdown is selected the record is updated rather than created & disappear, this allows the 2nd dropdown query to read the data saved in the first dropdown attribute.

Hope this makes sense.
If it doesn't feel free to reply and I'll try and explain better.

Thanks Jordan
pureist
Posts: 427
Joined: Sun Jan 24, 2016 10:00 pm

Re: Dropdown linked to another dropdown

Post by pureist »

Are you saying the following issue/limitation which existed about a year ago:
Issue:
When a Plain Text Attribute has Choices which are determined by a Query (Existing or Custom) the query will return zero records (and thus the dropdown will have no items) IF the query contains dynamic criteria obtained at runtime.


Is now resolved?

ie. you have a dropdown on a plain text attribute and the that plain text attribute has its options populated dynamically via a query, which requires the instance being edited in the form to be passed to the query to be used in its criteria?

And it now works?
JordanMaxim wrote:Hi,

Thought I better give an update incase anyone comes across this in future.
I have phoned Vladimir and we have found a solution.

I am now using a process to first create the record and then view the record.
By doing it this way the "Save form when selection changes" option on the first plain text / dropdown attribute works as it has a record to update.

Now when the dropdown is selected the record is updated rather than created & disappear, this allows the 2nd dropdown query to read the data saved in the first dropdown attribute.

Hope this makes sense.
If it doesn't feel free to reply and I'll try and explain better.

Thanks Jordan
Jaymer
Posts: 2451
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Dropdown linked to another dropdown

Post by Jaymer »

Jordan, I'm glad to hear you have a solution that works.
Can you record a simple phone video so the rest of us can see this in action?
thx
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
JordanMaxim
Posts: 8
Joined: Sun May 28, 2017 10:03 pm
Location: Rotorua, New Zealand
Contact:

Re: Dropdown linked to another dropdown

Post by JordanMaxim »

Hi

@pureist Yes I guess I am saying that :D
@Jaymer I hope that my PDF explains it easy enough..

I have attached a PDF explaining how i'm using dropdowns on plain text attributes not referenced attributes.
Thanks to Vladimir for his help.

PDF LINK:
http://docdro.id/EHJorj6

Regards
Jordan
pureist
Posts: 427
Joined: Sun Jan 24, 2016 10:00 pm

Re: Dropdown linked to another dropdown

Post by pureist »

Well, the last word from Support last year about this issue was:

"Dynamic choices [for Plain Text Attributes] were never supposed to work like that [ie. query criteria determined dynamically at run-time using Instance in context]."

So it must have since been rectified. Shame the rectification wasn't notified in the changelog.

I know Jaymer especially would liked to have been notified of this specific functionality improvement.
Jaymer
Posts: 2451
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Dropdown linked to another dropdown

Post by Jaymer »

Jordan,
1) THANKS for taking time to write that up - so much simpler to see with pictures :)
2) That strategy of "create a rec first, then edit it" is one that I've see proposed several times over the past few years. Some things seem to "work better" and you've found one, for sure.
3) Imagine if you'd like to have a default selection for CHANGE TYPE (your last red box on page 2) instead of it being blank - so the user wouldn't even have to mess with it for most of the cases. I wonder if thats possible - but, hey, i'm sure you're happy just to have achieved this!
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply