Jyothish
Novice

Smartform Dropdown Box rules

Hi

I am totally new to K2 and smart form. I have the following scenario.

 

Department

ID

Name

 

SecurityModel

ID

Name

 

DeptSecurityModel

ID

DeptId

SecurityModelId

 

The smart form has a Dropdown Box and need to be loaded with only mapped Security model for a Department. Can someone help me to write the rules for it? Any help of this greatly appreciated.

0 Kudos
Reply
6 Replies
AhmadAbdullah
Apprentice

Re: Smartform Dropdown Box rules

Dear ,

 

Just to understand ur question more , you want to have a security model drop down list filtered by department id?

so u want to set a department first , then the second drop down list filters security models depending on department value ?

 

best regards .

0 Kudos
Reply
Jyothish
Novice

Re: Smartform Dropdown Box rules

 

Thanks for your reply, AhmadYaqub

Yes your right, I want o filter the SecurityModel with DeptId, and load that in the dropdown box, 

 

Regards

Jyothish George

0 Kudos
Reply
AhmadAbdullah
Apprentice

Re: Smartform Dropdown Box rules

dear ,

well , the first drop down list will have Departments smartobject as "Data Source" , u can set the data source from the drop down list properties on right down side .

the second drop down list will have ur third table as data source , dept Security Model , but when u specify that data source , u will have couple of configurations ,

one of them is Filtering the drop down list according to anothers control value .

from here i think the link i got will help u better , instead of me keep on writing steps like this.

hope it helps u find the solution u need ,

http://help.k2.com/onlinehelp/K2smartforms/UserGuide/4.6.10/default.htm#HowTo_SpecifyDefaultValuesUs...

 

Go there and read Example Scenario part .

Best Regards.

 

0 Kudos
Reply
Jyothish
Novice

Re: Smartform Dropdown Box rules

Hi, 

 

I have only One dropdown Box which is SecurityModel, not 2, no dependant dropdowns, just need to filter many to many,

 

 

Regards

Jyothish George

 

0 Kudos
Reply
AhmadAbdullah
Apprentice

Re: Smartform Dropdown Box rules

Dear ,

its fine , u could also filter in another way , well , when you need to set the data source as the third table smart object "many to many"

im nt rly sure from where u get the departmentID value , but oh well ill assume its already in ur smartform somehow in a text box or data label ,

so u need to go to the view initialize method , there u will find a rule "Populate list control (ur drop down list) with data" , configure that rule

u will find "filter" part inside , go there and add  a new filteration , which is "DepartmentID" = (the value for departmentID on ur form)

-note : that case will work that way only if the departmentID is already there on ur smartform before the initializing .

 

the second scenario could be that u send departmentID from previous form to this Form , which will make 1 modification , which is

if u send department id from previous form to this form into a datalabel or textbox ,

all u need to do is delete "populate list control with data" from view initialize and move it to another rule ill show now

"when a control executes a method " method is changed , and the control is the data label u receive departmentID in .

inside this rule u will need to re add that "populate list control with data" rule .

to make sure u filter the population with departmentID is nt empty .

 

Best regards .

0 Kudos
Reply
Jyothish
Novice

Re: Smartform Dropdown Box rules

Hi AhmadYaqub

 

Thanks for the response, I have to make a view combining Security Model and Deaprtment , through DeptSecurityModel. Now I can filter the vlaues on the dropwdown with deptId. I am not sure any other better way to accomplish this. This is about filtering many to many inside the dropdown box. I will update this if I find any better solution for this.

Regards
Jyothish

0 Kudos
Reply