protecting field in roster

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Forum rules
New release: CSPro 8.0
Post Reply
RERII
Posts: 56
Joined: March 4th, 2015, 11:34 am

protecting field in roster

Post 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.
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: protecting field in roster

Post 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;
Post Reply