Set relationship based on combo box selection

This has to be easy, I’m just not seeing it.

I have a combo box that gets it’s values from a table. Both ID and StateName
I have a portal based on a relationship between tbl_state and tbl_juris.

How do I update the portal to reflect the relationship.

thanks
KS

Hi Keith,

kschuster:
I have a combo box that gets it’s values from a table. Both ID and StateName

This combobox uses a global or some table column as dataprovider ?

kschuster:
I have a portal based on a relationship between tbl_state and tbl_juris.

Is that relationship between this dataprovider that that you use for the combobox and tbl_juris ? If not then there is your problem.

Hope this helps.

I have had two ways to fill the combo. 1. valuelist from tbl_states and 2. a method
function refreshStateList()
{
var maxReturedRows = 60;
var query = ‘select stateName, StateID from tbl_states’;
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, maxReturedRows);
var nameArray = dataset.getColumnAsArray(1);//put 1st column in array
var idArray = dataset.getColumnAsArray(2);//put 2nd column in array
application.setValueListItems( “stateList”, nameArray , idArray )
}

I guess my question at this point is how do you create a relationship on a global. When I go into the relationship builder all I see are tables

Hi Keith,

kschuster:
I guess my question at this point is how do you create a relationship on a global. When I go into the relationship builder all I see are tables

Just scroll further down in the valuelist and you will see the globals.

I would have expected that when create a relation the globals would be a selection as source. It’s not there… just the tables. What am I missing. I’m running 4.0

Make sure you hit save (command-s/ctrl-s) and reopen the relation window.
Also globals will only work on the left side of the relationship but you probably know this already.

Hope this helps.

It’s just not there. See the attached image.
global var companySelected is set.
Pop up for source doesn’t have the global, just tables

Ah yes, you do need to select a server and table first. Then when you need to select the column the globals are at the bottom of the list.
I know, not very intuitive. :?

AHHHHHH… There is it. Your right not intuitive at all.

Thanks!!!