1 Reply Latest reply: Aug 26, 2012 4:41 AM by appsfh RSS

    How to create an Undefined Code Combination from API? (Urgent)

    appsfh
      Hi All,

      I used the following API to create the code combinations in a Inventory custom form.

      SELECT CHART_OF_ACCOUNTS_ID INTO :PARAMETER.CHART_OF_ACCOUNTS_ID
      FROM ORG_ORGANIZATION_DEFINITIONS
      WHERE ORGANIZATION_ID = :PARAMETER.ORG_ID;

      FND_KEY_FLEX.DEFINE(
      BLOCK => 'XX_MRN_TRX_HEADERS',
      FIELD => 'TO_ACCOUNT',
      CODE => 'GL#',
      APPL_SHORT_NAME =>'SQLGL',
      NUM => ':PARAMETER.CHART_OF_ACCOUNTS_ID',
      ID => 'TO_ACCOUNT_ID',
      VRULE => '\\nSUMMARY_FLAG\\nI\\nAPPL=SQLGL;NAME=GL_NO_PARENT_SEGMENT_ALLOWED\\nN\\0GL_GLOBAL\\nDETAIL_POSTING_ALLOWED\\nE\\nAPPL=INV;NAME=INV_VRULE_POSTING
      nN',
      REQUIRED => 'N',
      DINSERT => 'Y',
      VALIDATE => 'FULL',
      USEDBFLDS => 'N');

      This creates the correct ccid if the combination is already available in GL (gl_code_combinations_kfv), But when its a new combination it returns '-1'.
      How can I create an Undefined Code Combination from API in custom forms?

      If any one one can help me on this it'll be a great help.

      Thanks