Modify Mode but still data Changes using Sysparm

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
Yass
Posts: 103
Joined: November 11th, 2017, 1:26 am

Modify Mode but still data Changes using Sysparm

Post 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;
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Modify Mode but still data Changes using Sysparm

Post 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.
Yass
Posts: 103
Joined: November 11th, 2017, 1:26 am

Re: Modify Mode but still data Changes using Sysparm

Post by Yass »

Thanks Josh.
Post Reply