Friday, August 31, 2012

Instance Migration Scripts - Form Personalization Rules


--  Verify Personalization Rules
SELECT   ffcr.SEQUENCE "Seq", ffcr.description "Description",
         DECODE (ffcr.rule_type,
                 'F', 'Form',
                 'A', 'Function',
                 'Other'
                ) "Level",

         ffcr.enabled "Enabled", ffcr.trigger_event "Trigger Event",
         ffcr.trigger_object "Trigger Object", ffcr.condition "Condition",
         DECODE (ffcr.fire_in_enter_query,
                 'Y', 'Both',
                 'N', 'Not in Enter-Query Mode',
                 'O', 'Only in Enter-Query Mode',
                 'Other'
                ) "Processing Mode"
    FROM apps.fnd_form_cusm_rules ffcr
   WHERE ffcr.function_name = 'ONT_XYZ1'
     AND ffcr.form_name = 'XYZ1'
ORDER BY ffcr.SEQUENCE;
  
--  Verify Personalization Rules along with Scopes
SELECT   ffcr.SEQUENCE "Seq", ffcr.description "Description",
         DECODE (ffcr.rule_type,
                 'F', 'Form',
                 'A', 'Function',
                 'Other'
                ) "Level",
         ffcr.enabled "Enabled", ffcr.trigger_event "Trigger Event",
         ffcr.trigger_object "Trigger Object", ffcr.condition "Condition",
         DECODE (ffcr.fire_in_enter_query,
                 'Y', 'Both',
                 'N', 'Not in Enter-Query Mode',
                 'O', 'Only in Enter-Query Mode',
                 'Other'
                ) "Processing Mode",
         DECODE (ffcs.level_id,
                 '10', 'Industry',
                 '20', 'Site',
                 '30', 'Responsibility',
                 '40', 'User',
                 'Other'
                ) "Context Level",
         ffcs.level_value "Context Value"
    FROM apps.fnd_form_cusm_rules ffcr, apps.fnd_form_cusm_scopes ffcs
   WHERE ffcr.function_name = 'ONT_XYZ1'
     AND ffcr.form_name = 'XYZ1'
     AND ffcr.ID = ffcs.rule_id(+)
ORDER BY ffcr.SEQUENCE, ffcs.level_id;

--  Verify Personalization Rules along with Actions
SELECT   ffcr.SEQUENCE "Seq", ffcr.description "Description",
         DECODE (ffcr.rule_type,
                 'F', 'Form',
                 'A', 'Function',
                 'Other'
                ) "Level",
         ffcr.enabled "Enabled", ffcr.trigger_event "Trigger Event",
         ffcr.trigger_object "Trigger Object", ffcr.condition "Condition",
         DECODE (ffcr.fire_in_enter_query,
                 'Y', 'Both',
                 'N', 'Not in Enter-Query Mode',
                 'O', 'Only in Enter-Query Mode',
                 'Other'
                ) "Processing Mode",
         ffca.SEQUENCE "Action Seq", ffca.action_type "Action Type",
         ffca.summary "Action Description", ffca.LANGUAGE "Action Language",
         ffca.enabled "Action Enabled", ffca.property_value,
         ffca.argument_type, ffca.target_object, ffca.object_type,
         ffca.folder_prompt_block, ffca.MESSAGE_TYPE, ffca.MESSAGE_TEXT,
         ffca.builtin_type, ffca.builtin_arguments, ffca.property_name,
         ffca.menu_entry, ffca.menu_label, ffca.menu_seperar,
         ffca.menu_enabled_in, ffca.menu_action, ffca.menu_argument_long,
         ffca.menu_argument_short, ffca.action_id,
         ffca.request_application_id
    FROM apps.fnd_form_cusm_rules ffcr, apps.fnd_form_cusm_actions ffca
   WHERE ffcr.function_name = 'ONT_XYZ1'
     AND ffcr.form_name = 'XYZ1'
     AND ffcr.ID = ffca.rule_id(+)
ORDER BY ffcr.SEQUENCE, ffca.SEQUENCE;