Page 1 of 1

Modify Mode but still data Changes using Sysparm

Posted: June 11th, 2018, 9:10 am
by Yass
Hi Cspro,

I used the codes below to pass the interviewer codes from a Menu program to main application. It works alright but my issue is when the data
is send to the Supervisor via Bluetooth and the Supervisor logins using the Menu Program to review the data, the Interviewer code changes from the original interviewer to the Supervisor code in the main data. I did used demode()=add then.... it still not working. Please how do I fix this so the original interviewer code is kept.
Is it also a way to let Supervisor not able to change data collected from the interviewer ... simply review and send. I tried "Lock=modify" in my pff file and it won't allow the Supervisor to step through the data. Thanks always Cspro

Code: Select all



preproc
//if demode() = add then....
if sysparm("INTERVIEWER_CODE") <> " " then
    ENUM_CODE = tonumber(sysparm("INTERVIEWER_CODE"));
  
   

    // protect field so the interviewer cannot modify it
    set attributes ($) protect;

endif;

Re: Modify Mode but still data Changes using Sysparm

Posted: June 11th, 2018, 10:29 am
by josh
Instead of using demode() you can check if the field has already been filled in by seeing if the current value is blank (notappl). Since you are in the preproc you need to use visualvalue to check the value:
preproc
if visualvalue($) = notappl then
    
if sysparm("INTERVIEWER_CODE") <> " " then
        ENUM_CODE =
tonumber(sysparm("INTERVIEWER_CODE"));
    
endif;

    
// protect field so the interviewer cannot modify it
    set attributes ($) protect;
else
    
// already filled in
    set attributes ($) protect;
endif;
There is not currently a way to prevent the supervisor from modifying the data. Adding such a mode is on our todo list.

Re: Modify Mode but still data Changes using Sysparm

Posted: June 11th, 2018, 10:44 am
by Yass
Thanks Josh.