Announcement

Collapse
No announcement yet.

Clear fields if other fields change their values

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Clear fields if other fields change their values

    Hello,

    We are using both CPDM 3.21 and Coding 3.1. I would like to clear out the coding fields, which are protected from data entry, in the clinical dataset if any one of a few specific fields are changed during 'UPDATE' mode.

    Below is a screen cap of my screen.



    Thanks,
    Jason

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Hi Jason,

    Here's sample code that blanks out INITIALS if GENDER is changed and is placed in the onUpdate method. You should be able use this technique to do what you are asking. If you also use it in the onEnter, then you will see the results before the update occurs.


    ** Get record information object **;

    dcl object f info;
    f=_self_.frameid;
    f._getNumVar('recordInfo',info);
    if info.statusCode in('N','V','P') then do;
    originalValuesList=getniteml(info.recordValuesList,'ORIGINALVALUES');

    if getnitemc(getniteml(originalValuesList,'GENDER'),'DATAVALUE')^=gender.text

    then initials.text='';
    end;

    ** Note: if the field is formatted then use SCREENVALUE in place of DATAVALUE;


    I hope this helps,
    Bob
    Last edited by Bob Borysko; 04-09-2014, 03:23 PM.
Working...
X