Page 1 of 1

protecting field in roster

Posted: May 3rd, 2019, 7:32 am
by RERII
So i am facing a problem. When I am in the roster form if am dealing with a man i don't want the fertility questions to be asked for that particular occurrence I don't even want the researcher to navigate back to that particular question. But when i use the set attribute for the occurrence it blocks all the fertility question for all other occurrences.

Re: protecting field in roster

Posted: May 3rd, 2019, 11:45 am
by Gregory Martin
What you need to do is have the protection code in an onfocus, which will get executed regardless of whether you're moving forward or backward in the roster. Something like this:
PROC FERTILITY_QUESTION

onfocus

    if
MALE = 1 then
        setproperty
(FERTILITY_QUESTION, "Protected", "Yes");
   
else
        setproperty
(FERTILITY_QUESTION, "Protected", "No");
   
endif;