Thursday 9 April 2015

form personalization tables and form personalization Query




SELECT   fpt.application_name, ff.form_name source_form_name,
         fft.user_form_name,              -- fft.description form_description,
                            fff.function_name, ffft.user_function_name,
         ffft.description function_description,
         ffcr.SEQUENCE personalize_rule_sequence,
         ffcr.description personalize_rule_description,
         DECODE (ffcr.rule_type,
                 'F', 'Form',
                 'A', 'Function'
                ) personalize_rule_level,
         ffcr.enabled personalize_rule_enabled,
         ffcr.trigger_event personalize_rule_event, ffcr.trigger_object,
         ffcr.condition personalize_rule_condition,
         DECODE (ffcs.level_id,
                 10, 'Industry',
                 20, 'Site',
                 30, 'Responsibility',
                 40, 'User'
                ) context_level,
         DECODE (ffcs.level_id,
                 10, '',
                 20, '',
                 30, frt.responsibility_name,
                 40, fu.user_name
                ) context_level_value,
         ffca.SEQUENCE action_sequence,
         DECODE (ffca.action_type,
                 'P', 'Property',
                 'M', 'Message',
                 'B', 'Builtin',
                 'S', 'Menu',
                 ''
                ) action_type,            --  ffca.summary action_description,
         ffca.enabled action_enabled,
         DECODE (ffca.LANGUAGE,
                 '*', 'All',
                 'US', 'American English',
                 'AR', 'Arabic'
                ) action_language,
         DECODE (ffca.action_type,
                 'B', ffca.builtin_type,
                 NULL
                ) action_builtin_type,
         DECODE (ffca.action_type,
                 'B', ffca.builtin_arguments,
                 NULL
                ) action_builtin_arguments,
         ffcr.last_update_date
    FROM fnd_application fp,
         fnd_application_tl fpt,
         fnd_form ff,
         fnd_form_tl fft,
         fnd_form_functions fff,
         fnd_form_functions_tl ffft,
         fnd_form_custom_rules ffcr,
         fnd_form_custom_scopes ffcs,
         fnd_responsibility_tl frt,
         fnd_user fu,
         fnd_form_custom_actions ffca,
         fnd_form_custom_prop_list ffcpl
   WHERE                                           ----------------APPLICATION
         fp.application_id = fpt.application_id
     AND fpt.LANGUAGE = 'US'                     ------------------------ FORM
     AND fpt.application_id = ff.application_id
     AND ff.form_id = fft.form_id
     AND fft.LANGUAGE = 'US'                 ------------------------ FUNCTION
     AND ff.form_id = fff.form_id
     AND fff.function_id = ffft.function_id
     AND ffft.LANGUAGE = 'US'             ------------------------ Custom Rule
     AND ff.form_name = ffcr.form_name
     AND ffcr.function_name =
                        fff.function_name
                                         ------------------------ Custom Scope
     AND ffcr.ID = ffcs.rule_id
     AND ffcs.level_value = frt.responsibility_id(+)
     AND frt.LANGUAGE(+) = 'US'
     AND ffcs.level_value = fu.user_id(+)
                                       ------------------------ Custom Actions
     AND ffcr.ID = ffca.rule_id
     AND DECODE (ffca.action_type, 'P', ffca.property_name, 79) =
                                                             ffcpl.property_id
     AND DECODE (ffca.action_type, 'P', ffca.object_type, 'ITEM') =
                                                              ffcpl.field_type
     AND ff.form_name = 'GMEBDTED'
     AND ffcr.SEQUENCE IN (62, 64, 65, 66)
ORDER BY fft.application_id,
         ff.form_name,
         ffcr.function_name,
         ffcr.SEQUENCE,
         ffcs.level_id,
         ffcs.level_value,
         ffca.SEQUENCE