1 Reply Latest reply on Apr 11, 2016 9:29 AM by wikki26

    Custom Form: Accounting Flexfield is giving error

    wikki26

      Hi,

       

      I have developed a custom form. I want to show Accounting Flexfield there.

       

      I am getting an error like pic:

      pic.png

       

      I have double check, all segments are set to Displayed Yes in Chart of Accounts.

       

      PLSQL Code is given below:

       

      PROCEDURE initialize

      IS

         CURSOR get_cao

         IS

            SELECT   TO_CHAR ( id_flex_num )

              FROM   fnd_id_flex_structures

             WHERE   id_flex_structure_code = 'ACCOUNTING_FLEXFIELD' AND id_flex_code = 'GL#';

       

       

         v_cao   VARCHAR2 ( 1000 );

         vrule   VARCHAR2 ( 2000 );

      BEGIN

         OPEN get_cao;

       

       

         FETCH get_cao INTO   v_cao;

       

       

         IF get_cao%NOTFOUND

         THEN

            v_cao := '101';

         END IF;

       

       

         CLOSE get_cao;

       

       

         vrule := '\\nSUMMARY_FLAG\\nI\\nAPPL=SQLGL;NAME=GL_NO_PARENT_SEGMENT_ALLOWED\\nN';

       

       

         app_standard.event ( 'WHEN-NEW-FORM-INSTANCE' );

         fnd_key_flex.define ( block             => 'XX_TEMP_DFF_TEST'

                             , field             => 'ACCOUNTING_FLEXFIELD'

                             , id                => 'CODE_COMBINATION_ID'

                             , description       => 'ACCOUNTING_FLEXFIELD_DESC'

                             , appl_short_name   => 'SQLGL'

                             , code              => 'GL#'

                             , num               => v_cao

                             , title             => 'TEST'

                             , VALIDATE          => 'FULL'

                             , qbe_in            => 'Y'

                             , derive_always     => 'Y'

                             , updateable        => ''

                             , vrule             => vrule

                             , where_clause      => 'summary_flag != ''Y'''

                             , query_security    => 'Y'

                             , displayable       => 'ALL' );

      END initialize;

       

      How i can fix this issue?

       

      Another question is, how I can insert foreign keys under Application Developer > Database > Tables > Foreign Keys

       

      Regards,

      Waqas