Skip to main content

Hi,

 

I have three Smart Objects (SO), one with IDs and names of people, another with only IDs of people and IDs of Departments they work in (it's an intersect table between People and Departments table), and the third one with IDs and names of Departments.

 

Now, according to department selected in a drop-down list, I want to populate or filter possible selections in the picker. The picker's data source must be the intersect SO. I can't display the associated SO's value (in this case the names of people), however, but only the selected SO's values (which are IDs). That is, there is no "Show items from an associated SmartObject" option in Picker, like there is one in Drop-down or ListBox controls.

 

The SOs are associated correctly.

 

Why is that?

 

Thanks,
Mike

Hello Mike,


 


Perhaps this KB article can provide some assistance for you:


 


http://help.k2.com/kb001441#


 


I am thinking that you can use the population of the picker controls action and on the filter page you can set a filter based off of what is in that dropdown menu.


 


So this option you are looking for wouldn't be on the control properties but instead in the action for when the view is initialized and the data is populated. Arguably you could also set this rule on the form level if necessary. It would still need to be a view rule though.


 


Hopefully that helps!


 


Regards,


Evan


Hi Evan,

 

the thing is, in the SO that is set as the data source (the intersect table) for the picker I do not have a name, only two IDs. These two are the only columns in the table.

 

I'd like to display the name from an associated SO. I can do so with drop-down and listbox controls.

 

Am I missing something?

 

Thanks


Dear ,

 

I do believe u r on the right track , all u need to do is click on the list column , change its control --> drop down list .

then configure its data source to show items from an associated SMO .

 

Regards.


I may not have mentioned it, but I have placed these controls on an item view, not on an editable list view.

I have two controls on the view (among others), one is a dropdown and the other is a picker. The dropdown control's source is linked to the SO with IDs and Names of Departments, while the picker's source is linked to the SO with IDs of Departments and IDs of People.

The picker should the filter the SO by Department ID selected in the dropdown. It does so, but it displays IDs of people, but I wanted to display the names of people found in the third associated SO with IDs and Names of People.

 

Thx


Dear ,

 

Sry for late answer ,

i do believe there are 2 ways to accomplish that ,

1- is by the associations of the SMO's and using many to many relationship to display values from the third table , but i cant really help with the steps .

2- is an easy way which i recommend if u r using sql service instance as data source , all u need to do is to create SQL stored procedure , to have (Department ID) as input parameter and returns list of the employees , using joins filtering by the department ID , then u could use that stored procedure as data source for the picker control (second control) .

and when department is changed u send the value for the picker to populate it with correct data .

 

Hope it helps!

Regards.


Reply