protect roster field

Discussions about CSEntry
Post Reply
mohdsami
Posts: 10
Joined: August 7th, 2014, 1:52 am

protect roster field

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

Re: protect roster field

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

Re: protect roster field

Post 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.
mohdsami
Posts: 10
Joined: August 7th, 2014, 1:52 am

Re: protect roster field

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

Re: protect roster field

Post 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.
mohdsami
Posts: 10
Joined: August 7th, 2014, 1:52 am

Re: protect roster field

Post by mohdsami »

Thanks a lot Gregory!!!

Got exactly what I wanted.
Post Reply