在form中启用会计科目弹性域

1.新建参数ORG_ID、CHART_OF_ACCOUNTS_ID、SET_OF_BOOKS_ID
2.在PRE_FORM中添加如下触发器:
-- ==========================================================
--Procedure Name  : 初始化FORM之前获取帐套ID、本位币及账户ID
-- ==========================================================
PROCEDURE pre_form IS
  l_coa_id        NUMBER;
  l_sob_id        NUMBER;
  l_org_id        NUMBER;
  CURSOR sob_cur(sob_id NUMBER) IS
    SELECT sob.set_of_books_id
          ,sob.chart_of_accounts_id
      FROM gl_sets_of_books sob
     WHERE sob.set_of_books_id = sob_id;
BEGIN
  --Set of Books ID
  l_sob_id := fnd_profile.value('GL_SET_OF_BKS_ID');
  IF (l_sob_id IS NULL) THEN
    fnd_message.set_name('FND', 'PROFILE-CANNOT READ');
    fnd_message.set_token('OPTION', 'GL_SET_OF_BKS_ID');
    fnd_message.error;
    RAISE form_trigger_failure;
  END IF;

  OPEN sob_cur(l_sob_id);
  FETCH sob_cur
    INTO l_sob_id
        ,l_coa_id;
  CLOSE sob_cur;

  :PARAMETER.ORG_ID               := to_number(l_org_id);
  :PARAMETER.SET_OF_BOOKS_ID      := to_number(l_sob_id);
  :PARAMETER.CHART_OF_ACCOUNTS_ID := to_number(l_coa_id);

END;
3.在when-new-form-instance触发器中添加初始化键弹性域代码
fnd_key_flex.define(BLOCK           => 'HR_VENDOR_M_INTERFACE',--块名
                    field           => 'LIABILITY_ACCOUNT',    --字段名
                    description     => 'LIABILITY_ACCOUNT_DSP',--字段描述(可选)
                    id              => 'ACCTS_PAY_CCID',       --存放ccid
                    appl_short_name => 'SQLGL',
                    code            => 'GL#',
                    num             => ':parameter.CHART_OF_ACCOUNTS_ID',
                    required        => 'N',
                    validate        => 'FULL',                 --是否需要验证,若不需要给'NONE'
                    where_clause    => 'SUMMARY_FLAG != ''Y''',
                    vrule           => 'GL_GLOBAL\\nDETAIL_POSTING_ALLOWED\\nI\\nAPPL=SQLAP;NAME=AP_ALL_POSTING_NA\\nY\\0\\nSUMMARY_FLAG\\nI\\nAPPL=SQLAP;NAME=AP_ALL_PARENT_FLEX_NA\\nN\\0GL_ACCOUNT\\nGL_ACCOUNT_TYPE\\nI\\nAPPL=SQLAP;NAME=AP_ALL_ONLY_LIAB\\nL',
                    usedbflds       => 'N');

4.修改账户ITEM的LOV为ENABLE_LIST_LAMP

阅读更多
换一批

没有更多推荐了,返回首页