4GL command button to launch HR13.3

 7 Replies
 0 Subscribed to this topic
 17 Subscribed to this forum
Sort:
Author
Messages
Woozy
Veteran Member
Posts: 709
Veteran Member
    I have a custom form, and I want to add a command button to each detail record pointing to HR13.3, similar to how the BN32 does it. I have created the button and pointed it to HR13.3, but when I inquire the button disappears. I've added matching keys to the .scr. What am I doing wrong?

    What determines whether a button shows or not?

    Thanks. Kelly
    Kelly Meade
    J. R. Simplot Company
    Boise, ID
    jaherb
    Veteran Member
    Posts: 164
    Veteran Member
      Kelly....

      This is actually controlled in the PD section of the program.   If you look at BN32PD you will see the following logic...

      089700         IF (EMDEPEND-FOUND)
      089800             IF  ((PLN-PLAN-TYPE     = "HL")
      089900             AND  (BNC-DEP-HEALTH    = "Y"))
      090000             OR  ((PLN-PLAN-TYPE     = "DN")
      090100             AND  (BNC-DEP-DENTAL    = "Y"))
      090200             OR  ((PLN-PLAN-TYPE     = "DL")
      090300             AND  (BNC-DEP-DEP-LIFE  = "Y"))
      090400                 IF  ((PLN-COVERAGE-TYPE  = "1")
      090500                 AND  (COP-COV-DEPENDENTS = "S" OR "D" OR "B"))
      090600                 OR  ((PLN-COVERAGE-TYPE  = "2")
      090700                 AND  (CVR-LIFE-ADD-FLG   = "S" OR "D" OR "B"))
                                 MOVE BEN-START-DATE TO DB-EMP-START
                                 MOVE HDBSET3-EMP-START
                                                     TO WS-DB-BEG-RNG
                                 PERFORM 850-FIND-BEGRNG-HDBSET3
                                 IF (HRDEPBEN-FOUND)
      090900                         MOVE 204         TO CRT-MSG-NBR
                                 ELSE
      090900                         MOVE 183         TO CRT-MSG-NBR
                                 END-IF
      090800                     MOVE "BNMSG"         TO CRT-ERROR-CAT
      091000                     PERFORM 790-GET-MSG
      091100                     MOVE CRT-MESSAGE     TO BN32F1-DEP (I1).


      The logic checks to see if there are dependents for particular employee.... If there are, in this case, will retrieve mesage 183 from msgmaint and move that value to the form field.... BN32F1-DEP(I1).   The value of this message, if you look it up, is "DEP".


      If there are not dependents that field is left blank and you will not see it on the form.


      Hope this helps and gets you going in the right direction.


      Woozy
      Veteran Member
      Posts: 709
      Veteran Member
        Hi Jim - That makes sense on the BN32, but I'm having this issue on my custom form that doesn't include this logic.

        I think the BN32 logic actually sets the value to "Dep" (msg 183) for no dependents or "Dep*" (msg 204) for with dependents. However, there are still records where no button appears as all, and this code doesn't appear to address that.
        Kelly Meade
        J. R. Simplot Company
        Boise, ID
        Woozy
        Veteran Member
        Posts: 709
        Veteran Member
          Ahhh! Thanks Jim - I see what you were saying, and you were right. I forgot that I'm not actually setting the button value in my code. Once I do that, it will appear.

          Thanks again!

          Kelly
          Kelly Meade
          J. R. Simplot Company
          Boise, ID
          jaherb
          Veteran Member
          Posts: 164
          Veteran Member
            In the case of the BN32 two conditions must be met... 1) dependents must exist and 2) they must also exist on the HRDEPBEN meaning they are qualified for benefits.  

            Not sure what is happening in your program, but you may want to try adding logic to move whatever value you want to that button when the program is repopulating the form.  I believe these fields are blank when the form is being populated from the inquiry statement.

            Haven't played around with the "disappearing buttons" all that much.

            Let me know how it works out for you.
            jaherb
            Veteran Member
            Posts: 164
            Veteran Member
              Kelly.... I just created a quick update form and a button to call the HR13 form. When I first call the form up, it shows the button. I then added logic to check for dependents.. if no dependents are found, I space out the button name and the button does not show. If dependents are found I move 'Dependent' to the button and the button is there.

              This does work.... so I think you will need to add logic to your program checking to see if there are dependents or not and then either move spaces to or populate the button.

              Good Luck

              Jim
              Woozy
              Veteran Member
              Posts: 709
              Veteran Member
                Thanks Jim! That is very helpful. I really appreciate it!

                Kelly
                Kelly Meade
                J. R. Simplot Company
                Boise, ID
                jaherb
                Veteran Member
                Posts: 164
                Veteran Member
                  Not a problem.. have a great weekend.