A. 创建表,表中包括弹性域结构列(context)和弹性域列
CREATE TABLE CUX_FORM_DFF_TEST
(
ITEM_ID NUMBER NOT NULL,
ITEM_NUMBER VARCHAR2(30) NOT NULL,
ITEM_NAME VARCHAR2(100) NOT NULL,
ITEM_DESCRIPTION VARCHAR2(255),
START_DATE_ACTIVE DATE,
END_DATE_ACTIVE DATE,
ATTRIBUTE_CATEGORY VARCHAR2(30),
ATTRIBUTE1 VARCHAR2(150),
ATTRIBUTE2 VARCHAR2(150),
ATTRIBUTE3 VARCHAR2(150),
ATTRIBUTE4 VARCHAR2(150),
ATTRIBUTE5 VARCHAR2(150),
ATTRIBUTE6 VARCHAR2(150),
ATTRIBUTE7 VARCHAR2(150),
ATTRIBUTE8 VARCHAR2(150),
ATTRIBUTE9 VARCHAR2(150),
ATTRIBUTE10 VARCHAR2(150),
ATTRIBUTE11 VARCHAR2(150),
ATTRIBUTE12 VARCHAR2(150),
ATTRIBUTE13 VARCHAR2(150),
ATTRIBUTE14 VARCHAR2(150),
ATTRIBUTE15 VARCHAR2(150),
CREATED_BY NUMBER NOT NULL,
CREATION_DATE DATE NOT NULL,
LAST_UPDATED_BY NUMBER NOT NULL,
LAST_UPDATE_DATE DATE NOT NULL,
LAST_UPDATE_LOGIN NUMBER
)
--Create Index
CREATE UNIQUE INDEX CUX_FORM_DFF_TEST_U1 ON CUX_FORM_DFF_TEST(ITEM_ID);
--Create Sequence
CREATE SEQUENCE CUX_FORM_DFF_TEST_S START WITH 1;
--Create Synonym
CREATE SYNONYM CUX_FORM_DFF_TEST FOR CUX_FORM_DFF_TEST;
CREATE SYNONYM CUX_FORM_DFF_TEST_S FOR CUX_FORM_DFF_TEST_S;
B. 创建视图,视图中包括弹性域相关列(非必需)
C. 使用AD_DD工具包注册表和表列
BEGIN
AD_DD.REGISTER_TABLE('XXE', 'CUX_FORM_DFF_TEST', 'T', 8, 10, 90);
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ITEM_ID', 1, 'NUMBER', 38, 'N', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ITEM_NUMBER', 2, 'VARCHAR2', 30, 'N', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ITEM_NAME', 3, 'VARCHAR2', 100, 'N', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ITEM_DESCRIPTION', 4, 'VARCHAR2', 255, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'START_DATE_ACTIVE', 5, 'DATE', 9, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'END_DATE_ACTIVE', 6, 'DATE', 9, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ATTRIBUTE_CATEGORY', 7, 'VARCHAR2', 30, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ATTRIBUTE1', 8, 'VARCHAR2', 150, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ATTRIBUTE2', 9, 'VARCHAR2', 150, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ATTRIBUTE3', 10, 'VARCHAR2', 150, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ATTRIBUTE4', 11, 'VARCHAR2', 150, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ATTRIBUTE5', 12, 'VARCHAR2', 150, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ATTRIBUTE6', 13, 'VARCHAR2', 150, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ATTRIBUTE7', 14, 'VARCHAR2', 150, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ATTRIBUTE8', 15, 'VARCHAR2', 150, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ATTRIBUTE9', 16, 'VARCHAR2', 150, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ATTRIBUTE10', 17, 'VARCHAR2', 150, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ATTRIBUTE11', 18, 'VARCHAR2', 150, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ATTRIBUTE12', 19, 'VARCHAR2', 150, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ATTRIBUTE13', 20, 'VARCHAR2', 150, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ATTRIBUTE14', 21, 'VARCHAR2', 150, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'ATTRIBUTE15', 22, 'VARCHAR2', 150, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'CREATED_BY', 23, 'NUMBER', 9, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'CREATION_DATE', 24, 'DATE', 9, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'LAST_UPDATED_BY', 25, 'NUMBER', 9, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'LAST_UPDATE_DATE', 26, 'DATE', 9, 'Y', 'N');
AD_DD.REGISTER_COLUMN('XXE', 'CUX_FORM_DFF_TEST', 'LAST_UPDATE_LOGIN', 27, 'NUMBER', 9, 'Y', 'N');
COMMIT;
END;
--可在EBS APP DEV -> Application -> Database -> Table 可查看已注册的表和字段。
D. 在Oracle EBS系统中注册描述性弹性域
E. 启用描述性弹性域
F.按照一般Form开发的步骤,创建相关对象
创建一个DF非数据库项,并设置属性
在Data Block中新增一个Item,命名为”DF”,其Subclass Information设置为TEXT_ITEM_DESC_FLEX,(List of Values设置为ENABLE_LIST_LAMP,Validate from List设置为NO,非必需)Database Item设置为NO。
给DF项和数据块添加必要的触发器和标准代码
为DF项添加WHEN-NEW-ITEM-INSTANCE触发器,并将其Execution Hierarchy属性从Override修改为Before,触发器代码如下: FND_FLEX.EVENT(‘WHEN-NEW-ITEM-INSTANCE’);
为DF项添加WHEN-VALIDATE-ITEM触发器,其代码为FND_FLEX.EVENT(‘WHEN-VALIDATE-ITEM’);
在DF项所在Data Block下添加几个Block级别的触发器,分别为
PRE-QUERY: FND_FLEX.EVENT(‘PRE-QUERY’);
POST-QUERY: FND_FLEX.EVENT(‘POST-QUERY’);
PRE-INSERT: FND_FLEX.EVENT(‘PRE-INSERT’);
PRE-UPDATE: FND_FLEX.EVENT(‘PRE-UPDATE’);
WHEN-VALIDATE-RECORD: FND_FLEX.EVENT(‘WHEN-VALIDATE-RECORD’);
WHEN-VALIDATE-ITEM: FND_FLEX.EVENT(‘WHEN-VALIDATE-ITEM’);
在PRE-FORM触发器中初始化弹性域
在Form级别的触发器PRE-FORM中使用FND_DESCR_FLEX.DEFINE来初始化描述性弹性域,如
FND_DESCR_FLEX.DEFINE(block => ‘ITEMS’,
field => ‘DF’,
appl_short_name => ‘CUX’,
desc_flex_name => ‘CUX_FORM_DFF_TEST’);
G. 编译Form并验证说明性弹性域
来源:CSDN
作者:Acenol
链接:https://blog.csdn.net/weixin_42683386/article/details/104014787