Announcement

Collapse
No announcement yet.

Skipping DE screens dynamically

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

  • Skipping DE screens dynamically

    Hi Greg and Ronni,

    Is there a way to skip DE screens dynamically? For example, CRF(2) will have data only when an indicator variable on CRF(1) is 'Yes'. During data entry, if this indicator variable is not 'Yes', I would like to skip over the DE screen for CRF(2), going straight to the screen for CRF(3), leaving CRF(2) without a record.

    Thanks,
    Ed
    Last edited by Ronni Rubenstein; 04-15-2009, 10:05 AM.

  • #2
    Hi Ed,

    I was able to conditionally skip a screen using the following:

    In the first screen of the display order, I placed the following code in onTerm method to set a flag in the environment list when 1=Male is selected:

    ************************;
    ** Add user code here **;
    ************************;
    dcl num rc;

    ** clear the flag if present **;
    if nameditem(envlist(),'SKIPPAGE') then
    rc=delitem(envlist(),nameditem(envlist(),'SKIPPAGE'));

    if gender.selectedItem='1=Male' then do;
    rc=insertc(envlist(),'YES',-1,'SKIPPAGE'); ** set flag;
    end;

    endmethod;


    On the second screen of the display order, I placed the following code in the onLoad method to check for the flag in the environment list and issue the PAGERIGHT command to advance to the next screen:


    ************************;
    ** Add user code here **;
    ************************;

    ** check for flag and skip to next page if found **;
    if nameditem(envlist(),'SKIPPAGE') then do;
    if getnitemc(envlist(),'SKIPPAGE')='YES' then call execcmdi('PAGERIGHT');
    dcl num rc=delitem(envlist(),nameditem(envlist(),'SKIPPAGE')); ** clear flag;
    end;


    endmethod;

    This works ok but will not prevent a user from scrolling back to the skipped screen.
    Last edited by Bob Borysko; 09-27-2011, 11:44 AM.

    Comment

    Working...
    X