I have a main block ( A ) which will prompt to the user based on the selection records from the query search. Records will then displayed in the tabular form and user will like to select further record based on a check box that created for further action. I have created a action button on when_button_pressed to insert the records that checked by the user.
My statement as below :-
INSERT INTO ACT_INV_GRN_LBL_TMP ( SELECT ITEM_CODE, ITEM_DESC, :A.TEXT_ITEM11 FROM ACT_VW_GRN_LBL WHERE :A.TEXT_ITEM11 = 1 AND GRN_NO = :A.GRN_NO );
But the screen seem like doing nothing after execute the button.
Help me please. Thanks.
Which means its not ending up in an error.
SELECT ITEM_CODE, ITEM_DESC, :A.TEXT_ITEM11 FROM ACT_VW_GRN_LBL WHERE :A.TEXT_ITEM11 = 1 AND GRN_NO = :A.GRN_NO
Can you query and see if the query returns any rows?
The problem is my check box ( text_item11 ) where if I click on the record and enable the check box for two records, the insert record only saved the last record where my cursor stop. The query result show three lines, I checked print for two lines, but it only insert to my temp table the last record.
My query in block A has returned 3 records. I checked first & third record and press on button to process. My script is as below :-
WHILE :ACT_VW_GRN_LBL.text_item11 = '1'
INSERT INTO ACT_INV_GRN_LBL_TMP ( SELECT ITEM_CODE, ITEM_DESC, :A.TEXT_ITEM11 FROM ACT_VW_GRN_LBL WHERE :A.TEXT_ITEM11 = '1' AND GRN_NO = :A.GRN_NO AND ITEM_CODE = :A.ITEM_CODE );
The first record that I checked was not insert into the table. Why ?
You are checking the last check box and then pressing the Button ? So i think your loop starts with the last record .
After GO_Block check where the cursor is with MESSAGE(:SYSTEM.CURSOR_RECORD). If it gives you last record, go to first record before you start the loop.
To got to first record you can use FIRST_RECORD built-in.
Hope this helps you.