scrgen form definition to display current date

Sort:
You are not authorized to post a reply.
Author
Messages
Demi
Veteran Member
Posts: 67
Veteran Member
    I'm trying to display, by default; the current date on a portal form using the scrgen form definition. ie. after the initial search box selection, the form would pop-up with the default values already populated. I've used various combinations, but can't seem to find one that works.  Can someone please share how to accomplish this?
    Judy Consoli
    Veteran Member
    Posts: 43
    Veteran Member
      Do you have Design Studio???

      If so it's easy to add default.  If not, then write back and I'll show you .xml code that design studio generates and maybe you can put it in the .xml code???
      Judy Consoli
      Veteran Member
      Posts: 43
      Veteran Member
        Here's design studio code - see defval="@TD"


        "text2" key="1" label="Date" nbr="_f10" nm="XPJ-DATE" row="2" sz="8" tp="Text"/>
        Demi
        Veteran Member
        Posts: 67
        Veteran Member
          Yes, I do have Design Studios!  But this is simply a cloned lawson program and I'ld rather stay away from DS if I can.  My program is a batch extract that will be run every day. The design specs intend for the batch to be 'scheduled' without being initiated by the end users. All of the selection criteria is requested to be hard-coded, including the 'current system date'.  I was shooting for pre-filled parameters on the form that would show up on the reports; as well as be changed if needed.......  ie --- kind of redundant when the report already shows the current date and time as part of the heading......My thoughts were generated from the fact that not all 'scheduled' jobs will be run everyday. What if the system is not available for more than one day; or what if they have to re-run the job for yesterday.  
          Ragu Raghavan
          Veteran Member
          Posts: 468
          Veteran Member
            How about make the date an optional field in .scr, and when running it leave it blank.
            In the PD file, have this logic in the 100-PROGRAM routine
            IF (PRM-DATE = ZEROES)
            MOVE WS-SYSTEM-DATE-YMD TO PRM-DATE
            END-IF
            Demi
            Veteran Member
            Posts: 67
            Veteran Member
              I like the way you think, Ragu.  I did something similar - I defaulted the screen date to 01/01/1754; then did the edit and replace in the PD. Your suggestion was right on track with what I was trying to accomplish. Thanks!
              You are not authorized to post a reply.