Paint Program with page Up page down

Sort:
You are not authorized to post a reply.
Author
Messages
L G
Advanced Member
Posts: 38
Advanced Member
    Could someone explain to me how to paint a program which has functionality similar to HR10 page up and page down to fetch records
    Even the relevant code sample in HR10 would suffice ?

    Thanks
    John Henley
    Senior Member
    Posts: 3348
    Senior Member
      Lalit, HR10 maintains the PASCRTY table. It's pretty hard to describe how to use paint to do that, but I'lll give it a try. What you want to do is concentrate on the F6-Define | Detail commands in the paint program.

      The first step is to select an area in which to "paint" the detail area. Position the cursor on a line and press Home to mark the start of the detail area. Then position the cursor (for starters do it on the next line) and press End to mark the end of the detail area.

      Next, select F6 Define | Detail | Enable to set up the detail area. This will automatically add a line FC to the detail area. Then use F2/F3 to put fields into the detail area. When you're done adding fields, use F6 Define | Detail | Form to specify the number of detail lines on the form. Finally, use F6 Define | Detail | Set to create the repeated lines of fields.

      It will take you some getting used to, and you'll probably have to do it a bunch of times before you're comfortable.

      Good Luck!
      Thanks for using the LawsonGuru.com forums!
      John
      L G
      Advanced Member
      Posts: 38
      Advanced Member
        Thanks for all your help
        I got it working
        Just a little more help is required
        Is this possible to extend this across tabs
        i.e to paint the detail area for a row across tabs and any examples if possible which are available for a program like that
        John Henley
        Senior Member
        Posts: 3348
        Senior Member
          Hi Lalit,
          Detail lines cannot extend across tabs, however you can create a tabbed region below the detail lines which is associated with the detail line. See AM20.6 as an example.
          Thanks for using the LawsonGuru.com forums!
          John
          L G
          Advanced Member
          Posts: 38
          Advanced Member
            hi thanks for the advice
            can u give me an example in the HR, PR , BN or PA system if possible
            Also when adding a dropdown option other than A,C,D in the .scr file and adding logic corresponding to it in the PD file
            I seem to be getting an error on click of change event Value not in list :A,C,D
            When I go to Define Event using F6 it gives me only Add, change and Delete options under Change event and no other way to insert a new event
            Am I getting something wrong here
            John Henley
            Senior Member
            Posts: 3348
            Senior Member
              Look at HR02.1 as another example.

              I'm not sure if you can define dropdown values than A, C, and D from within paint...you may have to generate the code and then do that in the .scr & PD.

              Usually at some point you "hit the wall" when doing a paint, and have to end up edit the .scr & PD, etc. and doing stuff directly in the code....at which point you CANNOT go back to the paint regenerate, as YOU WILL OVERWRITE the code changes you have been making...

              One of the things that gets defined in the .scr is "valid combinations". In other words, if you're custom line FC is 'B', the value combination would be 'CB'.

              Thanks for using the LawsonGuru.com forums!
              John
              mondrar
              Advanced Member
              Posts: 35
              Advanced Member
                John,
                Could you go one step further and show me how to create a field on a form that will allow you to drill around. I can add regular text boxes all day. I would really like to have a field that would allow me to choose from the previous entries I have added to this field. Any ideas...
                John Henley
                Senior Member
                Posts: 3348
                Senior Member
                  Richard, is ths for a custom table, or a standard Lawson table? If it's a standard table, you have to find out what the "system key number" is for the drill around that you want to use. Once you know what it is, you have a place on the paint form in which to enter it (like in this screen shot, '01' is the COMPANY field drillaround.

                  Figuring out what the key number is is the hardest part, since it's not well-documented nor understood. You have to dig thru the XX.sr/XX.or code for the respective system, then use skndef to find out the actual key number.

                  If it's for a custom table, you would need to add the key number via skndef, then add the drill-around definitions into the .sr/.or files.
                  Attachments
                  Thanks for using the LawsonGuru.com forums!
                  John
                  mondrar
                  Advanced Member
                  Posts: 35
                  Advanced Member
                    Thanks John, I'm trying to do this for a custom table. I'll give it a shot in the morning.
                    John Henley
                    Senior Member
                    Posts: 3348
                    Senior Member
                      Did you put your custom table in a custom system code, or in a standard system code. There are pros/cons to doing it either way.

                      Since it is a custom table you will need to define the key number (use Z as the first character per Lawson recommendations) in skndef (and remember you'll also need to use the appmetadiff utility to make sure it is also reflected in the metadata). Once you have the key number defined, you would put that key number into your screen definition, either via paint or, if you've generated the code, in the .scr file (or both if you plan to re-generate the code).

                      You will then need to "layout" the select lists and/or object views you want DrillAround to generate for you custom table. Keep it simple at first and probably just put one select list into the .sr file. Then run srgen for that system code.
                      Thanks for using the LawsonGuru.com forums!
                      John
                      Sam Simpson
                      Veteran Member
                      Posts: 239
                      Veteran Member
                        I would really recommend training and or reading Application Development workbench (plus the Standard) to really understand creating forms in Lawson. I have extensive training with Lawson and I still use these two references most of the times. Creating a screen like HR11 is not for the faint of heart. The cobol program behind these screens behaves differently depending on how you define the type of program (batch, online etc). The type of programs
                        dictates how the process flow with the logic. There are more to it than just merely painting a program. Learning kndef and skndef for drill (from drill down) and screen rules (sr) and object rules (or) is a must.
                        Sam Simpson
                        Veteran Member
                        Posts: 239
                        Veteran Member
                          Here's an example of a program that I created that uses keys for drilling down data. Tab-Forms will be displayed depending on type of certificates an employee has (or combo type). There are three tab-forms but actually it presents up to five because of the and/or relationships. Please notice the extensive use of keys for drilling purposes. I have created this screen on my own outside of paint program. I just use pgmdef to establish my program definition. I don't know how to attach my example so please pardon me if I paste it here.


                          $RELEASE 08.0.3
                          *
                          *
                          *
                          *******************************************************************************
                          * SCREEN Y406 (1)
                          *******************************************************************************
                          $FORM Y4061 S
                          $SECURITY NO
                          $DECIMALS NO
                          $NOLFCOK
                          $KEYFCS D
                          $DATAFCS AC
                          $NEXTFCS NP
                          $ADDFCS A
                          $CHGFCS C
                          $DELFCS D
                          $COPYFCS Y
                          $LDATAFCS
                          $FCPAIRS
                          $LSELECT
                          * 1 1 2 2 3 3 4 4 5 5 6 6 7 7 7
                          *...5....0....5....0....5....0....5....0....5....0....5....0....5....0....5...9
                          *------------------------------------------------------------------------------
                          $SCREEN Y4061 S
                          [Y406[ ] ?JOB Certificate Maintenance
                          + ]

                          |Proc Level [ ] |or 999 for ALL ; ;
                          |Department [ ] |or 99999 for ALL ; ;
                          |Job Code [ ] ; ;
                          |Seq Nbr &0000] |Start Date & ] |End Date & ] |Review Date & ]
                          |Certificate Type [1] ; ;
                          $TAB-REGION
                          $TAB-FORM TYPE1 " Type1 "

                          | Flg |Certificate

                          | [N] - [ ]

                          $END-TAB TYPE1
                          $TAB-FORM TYPE2&3 " Type2&3 "

                          | Flg |Certificates
                          | [N] - [ ] ; ;
                          | [N] - [ ] ; ;
                          | [N] - [ ] ; ;
                          | [N] - [ ] ; ;
                          | [N] - [ ] ; ;
                          | [N] - [ ] ; ;
                          | [N] - [ ] ; ;
                          | [N] - [ ] ; ;
                          | [N] - [ ] ; ;
                          | [N] - [ ] ; ;


                          $END-TAB TYPE2&3
                          $TAB-FORM TYPE4&5 " Type4&5 "

                          | Flg (Cert1 ; ; |Cert2) ; ; Flg |(Cert3 ; ; |Cert4)
                          | [N] - [ ] ; ; | [N] - [ ] ; ;
                          | [N] - [ ] ; ; | [N] - [ ] ; ;
                          | [N] - [ ] ; ; | [N] - [ ] ; ;
                          | [N] - [ ] ; ; | [N] - [ ] ; ;
                          | [N] - [ ] ; ; | [N] - [ ] ; ;
                          | [N] - [ ] ; ; | [N] - [ ] ; ;
                          | [N] - [ ] ; ; | [N] - [ ] ; ;
                          | [N] - [ ] ; ; | [N] - [ ] ; ;
                          | [N] - [ ] ; ; | [N] - [ ] ; ;
                          | [N] - [ ] ; ; | [N] - [ ] ; ;

                          $END-TAB TYPE4&5
                          $END-REGION
                          $END-SCR Y4061 S
                          * ELEMENT NAME
                          * LEVEL NAME TYPE LENGTH DEC REQ OC KN SC PICTURE
                          * ----- --------------------- -- ---- - -- -- --- - -----------------------
                          $TRANS Y4061 S
                          2 TC AL 06 SB
                          2 FC A 01 SF
                          2 ORIGINATOR P 06 RO
                          2 LJC-PROCESS-LEVEL A 05 SR LH5
                          2 PDESC A 30 SB LH6
                          2 LJC-DEPARTMENT A 05 SR LH9
                          2 DDESC A 30 SB LHA
                          2 LJC-JOB-CODE A 09 SR LH7
                          2 JDESC A 30 SB LH8
                          2 LJC-SEQ-NBR N 04 SL MD
                          2 LJC-START-DATE F 08 SB H08
                          2 LJC-END-DATE F 08 SL H38
                          2 LJC-REVIEW-DATE F 08 SB LHB
                          2 LJC-CERT-TYPE A 01 SB
                          2 TDESC A 40 SB
                          2 TYPE1-TAB AF 07 SB
                          2 TFLG1 A 01 SB
                          2 CERTL1 A 10 SB CE1
                          2 TYPE2-TAB AF 09 SB
                          2 GROUP-2 G SB
                          3 DET-GRP-2 G SB 10
                          4 TFLG2 A 01 LB
                          4 CERTL2 A 10 LB CE2
                          4 REL2 A 03 LB
                          2 TYPE3-TAB AF 09 SB
                          2 COMBO-TYPE1 A 03 SB
                          2 COMBO-TYPE2 A 03 SB
                          2 COMBO-TYPE3 A 03 SB
                          2 GROUP-3 G SB
                          3 DET-GRP-3 G SB 10
                          4 TFLGL3 A 01 LB
                          4 CERTL3 A 10 LB CE3
                          4 REL3 A 03 LB
                          4 TFLGR3 A 03 LB
                          4 CERTR3 A 10 LB CE4
                          4 RER3 A 03 LB
                          $END-TRANS Y4061 S
                          * NAME DEFAULT VALUE EDIT LIST
                          * -------------------- -------------------- ------------------------
                          $EDITS Y4061 S
                          FC I=Inquire
                          N=Next
                          P=Previous
                          A=Add
                          C=Change
                          D=Delete
                          LJC-PROCESS-LEVEL 999
                          LJC-DEPARTMENT 99999
                          LJC-SEQ-NBR 0
                          LJC-START-DATE @TD
                          LJC-CERT-TYPE 1 1=1= 1 certificate only
                          2=2= 1 or more certificate (OR)
                          3=3= 1 and more certificate (AND)
                          4=4= Combo (OR) certificates
                          5=5= Combo (AND) certificates
                          TFLG1 N Y=Y= Certif is Tracked
                          N=N= Certif not Tracked
                          TFLG2 N Y=Y= Certif is Tracked
                          N=N= Certif not Tracked
                          TFLGL3 N Y=Y= Certif is Tracked
                          N=N= Certif not Tracked
                          TFLGR3 N Y=Y= Certif is Tracked
                          N=N= Certif not Tracked

                          $END-EDITS Y4061 S
                          You are not authorized to post a reply.