(Please note that I am referring to grid components and A5W pages running on the WAS.)
Objective: to set the value of a numeric session variable to the value of the current record number in the active table.
Structure: In my first A5W page (Page 1.a5w) I have a grid that is set to "Add Records Only." After a new record has been successfully entered (upon a successful Submit operation), Page 1.a5w then redirects to a second A5W page (Page 2.a5w). Page 2.a5w contains a grid that is set to "Allow Update." This grid on Page 2.a5w ONLY updates records in the table-it does not insert or add new records.
Page 2.a5w contains a filter that selects a record equal to the number of the last record that was added in Page 1.a5w. That filter value in Page 2.a5w is a numeric session variable (session.targetRec_N) that was set in Page 1.a5w.
Everything is working fine except...I cannot successfully set the value of session.targetRec_N to the current record number. In the CanInsertRecord event of the grid on Page 1.a5w, I currently have the following code:
tbl=table.current()
recnum=tbl.recno()
session.targetRec_N=recnum
If I comment out the code above and add a line directly below it that assigns a constant to session.targetRec_N (e.g., session.targetRec_N=150) everything works as expected-i.e., the session variable is successfully passed to Page 2.a5w and it is correctly used in the filter expression. So I know the filter on Page 2.a5w is correct and I also know that session.targetRec_N is being passed to Page 2.a5w.
With what I have now, Page 2.a5w always updates Record = 1 in the table. I just need to set the session variable to the value of the current record in the table.
Any suggestion, strategies or insights would be greatly appreciated.
Objective: to set the value of a numeric session variable to the value of the current record number in the active table.
Structure: In my first A5W page (Page 1.a5w) I have a grid that is set to "Add Records Only." After a new record has been successfully entered (upon a successful Submit operation), Page 1.a5w then redirects to a second A5W page (Page 2.a5w). Page 2.a5w contains a grid that is set to "Allow Update." This grid on Page 2.a5w ONLY updates records in the table-it does not insert or add new records.
Page 2.a5w contains a filter that selects a record equal to the number of the last record that was added in Page 1.a5w. That filter value in Page 2.a5w is a numeric session variable (session.targetRec_N) that was set in Page 1.a5w.
Everything is working fine except...I cannot successfully set the value of session.targetRec_N to the current record number. In the CanInsertRecord event of the grid on Page 1.a5w, I currently have the following code:
tbl=table.current()
recnum=tbl.recno()
session.targetRec_N=recnum
If I comment out the code above and add a line directly below it that assigns a constant to session.targetRec_N (e.g., session.targetRec_N=150) everything works as expected-i.e., the session variable is successfully passed to Page 2.a5w and it is correctly used in the filter expression. So I know the filter on Page 2.a5w is correct and I also know that session.targetRec_N is being passed to Page 2.a5w.
With what I have now, Page 2.a5w always updates Record = 1 in the table. I just need to set the session variable to the value of the current record in the table.
Any suggestion, strategies or insights would be greatly appreciated.
Comment