Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: arr_curr() returns a value of one on form with SCROLLGRID  (Read 8055 times)
Candy M.
Posts: 139


« on: January 18, 2018, 06:18:51 am »

We encountered an issue today with our ERP application running BDL 3.10.09, GDC 3.10.11.  Server Centos 7.3, GDC Windows.

I have stripped down the forms and code to duplicate the issue.

Program:   cjminvinq.4gl
Forms:  cjminv.per, invqty-i.per

Run the program,   Click on Quantities Button.   Second form will display which is a SCROLLGRID.
Now, traverse the array.   Click Detail button on any line and the value of arr_curr() always returns a 1 instead
of the true row # in the program array.   Look in terminal window to see the value or see message displayed at bottom of form.

Now, when we were running our full application under the GBC through the GAS, the arr_curr() returned the proper value.
I tested this sample under 3.00 and it works.   This part of the ERP application has worked on all versions of BDL back to 2.32 as well.
When I changed the SCROLLGRID to TABLE in the form it works correctly.

Program:  cjminvinq.4gl
Code
  1. #
  2. DEFINE ninvloc         SMALLINT
  3.        CONSTANT        max_invloca = 250       # Max no elements in p_invloca,
  4.                                                #       p_invlocr
  5.        DEFINE
  6.        p_invloca       ARRAY[max_invloca] OF RECORD
  7.                        loccd    CHAR(8),     # Location
  8.                        locname  CHAR(30)      # Location Name
  9.                        END RECORD
  10. #
  11. MAIN
  12.  
  13.        IF ui.Interface.getFrontEndName() != "Console" THEN
  14.                CLOSE WINDOW SCREEN
  15.        END IF
  16.        DEFER INTERRUPT
  17.        OPEN WINDOW inv1_form WITH FORM "cjminv"
  18.                ATTRIBUTE (TEXT="Facilities")
  19. #
  20. #-------Display data found to user
  21. #
  22.        CALL cjmloadinvloc() RETURNING ninvloc
  23.        CALL cjmshoinvloc()
  24.  
  25. END MAIN
  26. FUNCTION cjmloadinvloc()
  27. #
  28.        DEFINE
  29.        i               SMALLINT                # Counter
  30.  
  31.        FOR i = 1 TO max_invloca
  32.                INITIALIZE p_invloca[i].* TO NULL
  33.        END FOR
  34.        LET p_invloca[1].loccd = "CANDY"
  35.        LET p_invloca[1].locname = "Candy Location"
  36.        LET p_invloca[2].loccd = "ATLA"
  37.        LET p_invloca[2].locname = "Atlanta Location"
  38.  
  39.        LET i = 2
  40.        RETURN i
  41. END FUNCTION
  42. #
  43. FUNCTION cjmshoinvloc()
  44. #
  45. #-------Local Variables
  46. #
  47.        DEFINE
  48.        i               SMALLINT        # Counter
  49.  
  50.        LET int_flag = FALSE
  51.        DISPLAY ARRAY p_invloca TO s_invloc.*
  52.                ATTRIBUTE (COUNT=ninvloc,UNBUFFERED)
  53.        BEFORE DISPLAY
  54.                CALL dialog.setActionActive("accept",0)
  55. #
  56. #
  57. #-------Quantities
  58. #
  59.        ON ACTION function4
  60.                LET i = arr_curr()
  61.                IF i != 0 THEN
  62.                        CALL invqty(i)
  63.                END IF
  64. #
  65. #-------Exit
  66. #
  67.        ON ACTION cancel
  68.                LET int_flag = FALSE
  69.                EXIT DISPLAY
  70. #
  71. #-------Close Application
  72. #
  73.        ON ACTION close
  74.                LET int_flag = FALSE
  75.                EXIT DISPLAY
  76.        END DISPLAY
  77.  
  78.        IF int_flag THEN
  79.                LET int_flag = FALSE
  80.        END IF
  81.  
  82. END FUNCTION
  83. #
  84. FUNCTION invqty(detline)
  85.  
  86.        DEFINE
  87. #
  88. #-------Miscellaneous Variables
  89. #
  90.        i               SMALLINT,               # Counter
  91.        detline         INTEGER,                # Detail Line
  92.        p_invqty        ARRAY[11] OF RECORD
  93.                        fldlab  CHAR(30),       # Field Label
  94.                        qty     DECIMAL(16,4)   # Quantity
  95.                        END RECORD
  96.  
  97.        OPEN WINDOW invqty_form WITH FORM "invqty-i"
  98.                ATTRIBUTE (TEXT="Quantities")
  99. #
  100. #-------Assign field labels
  101. #
  102.        LET p_invqty[1].fldlab = "Quantity on Hand"
  103.        LET p_invqty[2].fldlab = "Quantity on Sales Order"
  104.        LET p_invqty[3].fldlab = "Quantity on Sales Order Hold"
  105.        LET p_invqty[4].fldlab = "Quantity to be Picked"
  106.        LET p_invqty[5].fldlab = "Quantity to be Transferred Out"
  107.        LET p_invqty[6].fldlab = "Quantity Allocated"
  108.        LET p_invqty[7].fldlab = "Quantity on Purchase Order"
  109.        LET p_invqty[8].fldlab = "Quantity on Work Order"
  110.        LET p_invqty[9].fldlab = "Quantity In Transit"
  111.        LET p_invqty[10].fldlab = "Quantity Rejected             "
  112.        LET p_invqty[11].fldlab = "Quantity Available"
  113. #
  114. #-------Assign quantities
  115. #
  116.        LET p_invqty[1].qty = 0
  117.        LET p_invqty[2].qty = 0
  118.        LET p_invqty[3].qty = 0
  119.        LET p_invqty[4].qty = 0
  120.        LET p_invqty[5].qty = 0
  121.        LET p_invqty[6].qty = 0
  122.        LET p_invqty[7].qty = 0
  123.        LET p_invqty[8].qty = 0
  124.        LET p_invqty[9].qty = 0
  125.        LET p_invqty[10].qty = 0
  126.        LET p_invqty[11].qty = 0
  127. #
  128. #-------Display array
  129. #
  130.        LET int_flag = FALSE
  131.        DISPLAY ARRAY p_invqty TO s_invqty.*
  132.                ATTRIBUTE (COUNT=11,UNBUFFERED)
  133. #
  134. #-------Quantity Inquiry information
  135. #
  136.        ON ACTION subfunction1
  137.                LET i = arr_curr()
  138.                display "i ",i
  139.                display "arr_count ",arr_count()
  140.                message "i is ",i
  141.        END DISPLAY
  142.  
  143.        IF int_flag THEN
  144.                LET int_flag = FALSE
  145.        END IF
  146.  
  147.        CLOSE WINDOW invqty_form
  148.  
  149. END FUNCTION
  150.  
 

Form:  cjminvinq.per
Code
  1. SCHEMA formonly
  2. LAYOUT (TEXT="Item")
  3. VBOX
  4. FOLDER
  5. PAGE page2 (TEXT="Facilities",ACTION=page2)
  6. VBOX
  7. TABLE
  8. {
  9.  Facility  Facility Name
  10. [a2      -|b2                                                ]
  11. [a2      -|b2                                                ]
  12. [a2      -|b2                                                ]
  13. [a2      -|b2                                                ]
  14. [a2      -|b2                                                ]
  15. [a2      -|b2                                                ]
  16. }
  17. END
  18. GROUP group7
  19. GRID
  20. {
  21. [button21   ]
  22. }
  23. END
  24. END
  25. END -- end vbox
  26. END -- end page
  27. END -- end folder
  28. GROUP group14
  29. GRID
  30. {
  31. [button38] [button39]
  32. }
  33. END
  34. END
  35. END
  36. ATTRIBUTES
  37.  
  38. EDIT a2 = formonly.loccd TYPE CHAR,
  39.        COMMENTS = "Enter item facility.";
  40. EDIT b2 = formonly.locname TYPE CHAR,
  41.        NOENTRY;
  42.  
  43. BUTTON button21:function4, TEXT="Quantities", IMAGE="";
  44. BUTTON button38:accept, TEXT="OK", IMAGE="";
  45. BUTTON button39:cancel, TEXT="Cancel", IMAGE="";
  46. END
  47. INSTRUCTIONS
  48.        SCREEN RECORD s_invloc[6] (formonly.loccd,formonly.locname);
  49. END
  50.  

Form:  invqty-i.per
Code
  1. SCHEMA formonly
  2. LAYOUT
  3. VBOX
  4. SCROLLGRID
  5. {
  6. [f002                          ][f003          ]
  7. [f002                          ][f003          ]
  8. [f002                          ][f003          ]
  9. [f002                          ][f003          ]
  10. [f002                          ][f003          ]
  11. [f002                          ][f003          ]
  12. [f002                          ][f003          ]
  13. [f002                          ][f003          ]
  14. [f002                          ][f003          ]
  15. [f002                          ][f003          ]
  16. [f002                          ][f003          ]
  17. }
  18. END
  19. GROUP group1
  20. GRID
  21. {
  22. [button1 ][button2       ]
  23. }
  24. END
  25. END
  26. END
  27. END
  28. ATTRIBUTES
  29. LABEL f002 = formonly.fldlab;
  30. EDIT f003 = formonly.qty TYPE DECIMAL,
  31.        FORMAT="-------------&",
  32.        NOENTRY;
  33. BUTTON button1:cancel, TEXT="Cancel", IMAGE="";
  34. BUTTON button2:subfunction1, TEXT="Detail", IMAGE="";
  35. END
  36. INSTRUCTIONS
  37.        SCREEN RECORD s_invqty[11] (formonly.fldlab,formonly.qty)
  38. END
  39.  

I also submitted the issue to 4js USA support.

Thanks,
Candy

* cjminvinq.4gl (3.13 KB - downloaded 729 times.)
* cjminv.per (1.05 KB - downloaded 704 times.)
* invqty-i.per (0.93 KB - downloaded 725 times.)

* Screenshot.PNG (34.64 KB, 887x585 - viewed 1449 times.)
Bernard M.
Four Js
Posts: 45


« Reply #1 on: January 18, 2018, 11:57:33 am »

Hi Candy,

We registered GDC-3853 (Click on form button changes current row in SCROLLGRID) for this problem.
A workaround is to use a TABLE instead of a SCROLLGRID in invqty-i.per.
Sorry for the inconvenience and thanks for reporting.

Regards,
Bernard
Bernard M.
Four Js
Posts: 45


« Reply #2 on: January 18, 2018, 01:16:35 pm »

Candy,

The bug will be fixed for next MR due for the end of the month.

Regards,
Bernard
Candy M.
Posts: 139


« Reply #3 on: January 18, 2018, 03:01:56 pm »

Bernard,
     That's great!  Thanks so much!
Candy
Candy M.
Posts: 139


« Reply #4 on: January 19, 2018, 08:11:23 pm »

FYI.   This appears to fail in GDC over http as well (I had tested over GDC over ssh).
Candy
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines