Prevent operation without master record (prevent masterless operations)

Source: Internet
Author: User

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 ;

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.