Page 1 of 1

Dynamic Value Sets using pre-load file

Posted: June 1st, 2018, 5:34 am
by sokiya
Hi CSPro users,
I would want to implement a dynamic value set using a pre-load file. There are four levels that I would want to narrow down by filtering out the elements that aren't a subset of the previously selected value, in other words cascading select. Attached is an example of the pre-load file
I know there needs to be some tweak in the code below

Code: Select all

onfocus

if loadcase(location_DICT, SC_CODE) = 1 then

	numeric i;
	do i = 1 while i <= count(location_DICT.LOCATION_REC)
		labels(i) = VL_SL_NAME(i); 
		codes(i) = VL_SL_CODE(i);
	enddo;
	codes(i) = notappl; 
	setvalueset(SL_CODE, codes, labels);
endif;
Thanks for the help.

Re: Dynamic Value Sets using pre-load file

Posted: June 1st, 2018, 6:36 am
by josh
You can see some examples of cascading value sets here: http://teleyah.com/cspro/DCJune2015/05- ... -entry.pdf

Re: Dynamic Value Sets using pre-load file

Posted: June 1st, 2018, 7:59 am
by sokiya
Thanks Josh for the link. However, the outlined approach on cascading select doesn't use pre-load file so it may not answer my question. The one on Lookup files is the one that I did replicate but the challenge is to narrow at each level. The example used is straightforward since there are only two levels district and village. In my case, the levels are four, the lists are huge (hence the choice of a pre-load)

Re: Dynamic Value Sets using pre-load file

Posted: June 1st, 2018, 9:27 am
by josh
Here is an example that uses a lookup for multiple levels of geography.

Re: Dynamic Value Sets using pre-load file

Posted: June 1st, 2018, 9:50 am
by sokiya
Thanks Josh! This is exactly what I was referring to. Much appreciated.