• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

gSelectionCnt not zero'ing

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

  • gSelectionCnt not zero'ing

    I am using a multi select on a grid and then calling an RPG program to run and print the selected items. After the SetResponse('success':'true') ; I refresh the widget, expecting gSelectionCnt to Zero, but it doesn't and continues to grow. Is there a piece that I am missing? Thanks!

  • #2
    What is your version of Valence?

    Comment


    • #3
      Valence Framework 6.3.20250821.0

      Comment


      • #4
        I cannot replicate this. Can you confirm the following below?

        1.)The grid has "Checkbox Row Selections" enabled and "Allow Multiple Selections" checked.
        2.) You have a button attached to your grid that calls an RPG program.
        3.) The back-end program references gSelectionCnt. The back-end program processes and then returns success:true.
        4.) Upon succes=true, the front end is reloading the grid (how is it doing this)?
        5.) Do the selections against the grid go away after refreshing?

        Comment


        • #5
          Yes, the selections do go away after refreshing, but the value of gSelectionCnt do not. The only way that i can get the gSelectionCnt to Zero is to close the application...

          So here is the RPG Code below:
          Dcl-Proc Process;
          //SQL: SRMASTP Prefix(SR)
          Dcl-s gUser Char(10) ;
          Dcl-S lIndex like(gSelectionCnt) ;
          Dcl-S X_Exists Char(1) ;

          lIndex = gSelectionCnt ;
          For lIndex = 1 to gSelectionCnt ;
          @Loc = GetSelectionChar(lIndex:'SRLOC') ;
          @Itemno = GetSelectionChar(lIndex:'SRITM#') ;
          // Check for existing record
          Exec SQL Set Option Commit=*None ;
          Exec sql select 1 into: X_Exists from QS36F/SRMASTP
          where SRLOC = :@LOC AND SRITM# = :@ItemNo ;
          If X_Exists <> '1' ;
          setResponse('success':'false') ;
          SetResponse('msg':'SRLOC &/or SRITM# does Not Exist') ;
          return ;
          Endif ;
          Monitor ;
          p_SR0907C(@Loc:@ItemNo:@NbrCopy:@Rtn0907) ;
          On-Error ;
          @Rtn0907 = 'ER' ;
          EndMon ;
          EndFor ;

          SetResponse('success':'true') ;
          SetResponse('info':'Printing completed') ;
          gSelectionCnt = *Zeros ;
          return ;

          image.png?image.png????

          Comment


          • #6
            I'm going to need to see this run if possible. Can you reach out to support@cnxcorp.com to setup an online meeting?

            Comment


            • #7
              This is happening if Infinite Scrolling is active. It will be fixed for the next update.

              Comment

              Working...
              X