Forcing Dynamic Combo Boxes to re-query their list

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
AndySK
Posts: 4
Joined: Fri Jun 04, 2021 12:27 am

Forcing Dynamic Combo Boxes to re-query their list

Post by AndySK »

Hi Folks

This is my first post on this forum, so please go easy on me. I'm relatively new to AwareIM, but I have one problem which is driving me mad and I'm hoping someone has surely come across it before. I'm running AwareIM 8.6. Also, apologies if someone has already covered this, however I could not find any similar looking posts on this forum.

I have BO (called ProductItems) with a 'form' which contains a number of fields. Further down that form is a dynamic combobox which runs a query as follows...

FIND CreditBankHeader WHERE
CreditBankHeader.AccountNumber=ThisProductItems.Opportunity.AccountNumber
AND CreditBankHeader.Status='OK'
AND CreditBankHeader.Type='Contract'
AND CreditBankHeader.Unit=ThisProductItems.Unit
AND CreditBankHeader.OrderedOnOppConNumber=ThisProductItems.Opportunity.OppConNumber

Initially on the form load, 'ProductItems.Unit' is blank and thus the query for the combo box fails and loads nothing, as expected.

I've since come to the conclusion that Dynamic Combo queries only run on Form Load. Is this correct?

If I change the value of 'ProductItems.Unit', how can I get the combobox to refresh its list based on the updated value of ProductItems.Unit?

Thank you in anticipation.
Andy
Jaymer
Posts: 2080
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Forcing Dynamic Combo Boxes to re-query their list

Post by Jaymer »

hi, welcome.
away from desk, but there's a youtube video from AwareIM called Cascading Combo boxes (or similar). Check that

Also, a picture is ALWAYS helpful, in this case of your screen
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
PointsWell
Posts: 1198
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Forcing Dynamic Combo Boxes to re-query their list

Post by PointsWell »

If you are already referencing another BO then you'd probably be better creating a relationship attribute and then filtering it based on the in context BO

Eg
ProductItem.psCreditBankHeader
eagles9999
Posts: 2253
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Forcing Dynamic Combo Boxes to re-query their list

Post by eagles9999 »

Are you using Fetch All Records at Once?
Al At Once.jpg
Al At Once.jpg (200.59 KiB) Viewed 120 times
Cheers,
Mark
_________________
AwareIM 6.0, 8.4, 8.6 (build 2941) MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Chrome, Edge
Upcloud
Image
AndySK
Posts: 4
Joined: Fri Jun 04, 2021 12:27 am

Re: Forcing Dynamic Combo Boxes to re-query their list

Post by AndySK »

Hi Folks
First off, thank you all for taking the trouble to offer some help.
The two business objects are currently not related. Do they need to be in order for this to work?
Also, eagles9999, I'm not seeing the same properties on my attribute that you are seeing...
aim2.JPG
aim2.JPG (77.8 KiB) Viewed 109 times
I am on version 8.6 build 2937
Thank you all.
Kind regards
Andy
AndySK
Posts: 4
Joined: Fri Jun 04, 2021 12:27 am

Re: Forcing Dynamic Combo Boxes to re-query their list

Post by AndySK »

Hi All
I've now fixed this.

Thanks to Jaymer for the heads-up on the video. After watching this, things seemed to slot into place in my brain :-)

I've created a new attribute of type 'CreditBankHeader' but this doesn't have any relationship set up (by design). Then following the clues given by you chaps, I've made this new attribute a combo-box which loads the data based on a filter/query.
aim3.JPG
aim3.JPG (148.29 KiB) Viewed 104 times
Now the form looks like this and the combo shows the selectable results as expected. (Cosmetic work pending :D )
aim4.JPG
aim4.JPG (41.02 KiB) Viewed 104 times
A massive THANKS again to you all.
Post Reply