Found the bug of self-built form: (there are three data blocks, one header, two rows, and three sub-rows)
Operation: Enter the second data block and press Ctrl + F11 to query the tax invoice.
Solution:
1. You can try to Disable Ctrl + F11. I don't know how to do this...
2. Set the relationship between data block 1 and data block 2. One of the properties is to prevent operation without a master record. Select "yes" to solve this problem.
3. You can set query conditions.
1) set the pre-query of the second data block:
Code
1 Begin
2 If : Parameter. g_query_find = ' True ' Then -- Where clause with original settings
3 Copy (: query_find.tax_receept, ' Hek_ar_reciept_headers.tax_reciept_num ' );
4 Set_block_property ( ' Hek_ar_reciept_headers ' , Default_where, ' Nvl (match_flag, '' N '' ) = '' N '' ' );
5 : Parameter. g_query_find: = ' False ' ;
6 -- Fnd_message.debug (get_block_property ('hek _ ar_reciept_headers ', default_where ));
7 Elsif: hek_ar_reciept_v.h_header_id Is Not Null Then -- If there is a header record, nothing will be done
8 Null ;
9 Else -- This data block cannot be queried if there is no header record or otherwise
10 Set_block_property ( ' Hek_ar_reciept_headers ' , Default_where, ' 1 <> 1 ' );
11 -- Fnd_message.debug (get_block_property ('hek _ ar_reciept_headers ', default_where ));
12 End If ;
13 End ;
2) set the pre-query of the third data block:
Code
1 Begin
2 If : Hek_ar_reciept_headers.header_id Is Null Then -- If no row record exists, it cannot be queried.
3 Set_block_property ( ' Hek_ar_reciept_lines_v ' , Default_where, ' 1 <> 1 ' );
4 -- Fnd_message.debug (get_block_property ('hek _ ar_reciept_lines_v ', default_where ));
5 End If ;
6 End ;