Script to delete a DFF Context
The DFF segment screen doesn't allow deletion of context. But Oracle has internal API to delete context.
SET ECHO OFF
SET FEEDBACK OFF
SET SERVEROUTPUT ON SIZE 1000000
DECLARE
v_application_id NUMBER := 0;
v_descriptive_flexfield_name VARCHAR2(100) := 'FND_COMMON_LOOKUPS' ;
v_descriptive_flex_context_cod VARCHAR2(100) := 'XFND_CLWW_PURGE_FOLDER';
BEGIN
--FND_DESCRIPTIVE_FLEXS_PKG --this package is for DFF
--FND_DESCR_FLEX_CONTEXTS_PKG --this package is for DFF Context
--FND_DESCR_FLEX_COL_USAGE_PKG --this package is for DFF Column useage
--When creating a new DFF Context, it will check the DFF Column usage if the context is already used.
--so when deleting a DFF Context, both the context and column usage should be deleted.
FOR c IN (SELECT application_column_name
FROM fnd_descr_flex_column_usages
WHERE application_id = v_application_id
AND descriptive_flexfield_name = v_descriptive_flexfield_name
AND descriptive_flex_context_code = v_descriptive_flex_context_cod)
LOOP
fnd_descr_flex_col_usage_pkg.delete_row(
x_application_id => v_application_id
,x_descriptive_flexfield_name => v_descriptive_flexfield_name
,x_descriptive_flex_context_cod => v_descriptive_flex_context_cod
,x_application_column_name => c.application_column_name
);
END LOOP;
fnd_descr_flex_contexts_pkg.delete_row(
x_application_id => v_application_id,
,x_descriptive_flexfield_name => v_descriptive_flexfield_name
,x_descriptive_flex_context_cod => v_descriptive_flex_context_cod
);
--commit;
end;
No comments:
Post a Comment