Page 1 of 1

protect roster field

Posted: August 7th, 2014, 1:56 am
by mohdsami
Can anybody help me to know how to protect a particular field occurance in a roster. Like , I wand to protect a field in a roster based on value of previous field?

Re: protect roster field

Posted: August 12th, 2014, 12:17 pm
by Gregory Martin
You can write something like this:
if O13A = 1 then // prefill the value and protect it
    O14A = 0;
    
set attributes(O14A) protect;

else // make the interviewer enter the value
    set attributes(O14A) native;

endif;

Re: protect roster field

Posted: August 12th, 2014, 12:18 pm
by Gregory Martin
Also, there's no way to protect just a single occurrence of a field, so if you protect the value, it will protect all occurrences of the value. In that way, as the code above would do, you may have to protect and unprotect a value depending on what occurrence you're on.

Re: protect roster field

Posted: August 13th, 2014, 1:33 am
by mohdsami
Thanks Gregory !

I wanted to protect the single occurrence in a roster. But, as you stated, it is not possible.

Can you help me with one more query....suppose in a roster user is entering some field and then he clicks on another field in some other row, say 4th row, then how can I execute every preproc and postproc of every field in between?

Re: protect roster field

Posted: August 13th, 2014, 9:31 am
by Gregory Martin
If you have your application running in system controlled mode, then clicking on a field in another row will act like an advance statement, not a skip statement, and so it will execute the preprocs and postprocs of the fields in between.

Also, preprocs and postprocs only get executed as your move forward in your application. If you also want to add logic that gets executed when you move backward (as well as forward), you can look into the onfocus and killfocus events.

Re: protect roster field

Posted: August 17th, 2014, 1:38 pm
by mohdsami
Thanks a lot Gregory!!!

Got exactly what I wanted.