Mar 21, 2014

Query to find Form Personalization


I found this query at http://ravivarma1985.blogspot.com/2012/05/sql-query-to-get-list-of.html. Thought I would re-post it for my own personal reference. Might come in handy.


SELECT ffv.form_id          "Form ID",
       ffv.form_name        "Form Name",
       ffv.user_form_name   "User Form Name",
       ffv.description      "Form Description",
       ffcr.sequence        "Sequence",
       ffcr.description     "Personalization Rule Name"
  FROM fnd_form_vl             ffv,
       fnd_form_custom_rules   ffcr
 WHERE ffv.form_name = ffcr.form_name
 ORDER BY ffv.form_name, ffcr.sequence;



Query to find Legal Entity, Organization, Company Code


SELECT
       xep.legal_entity_id        "Legal Entity ID",
       xep.name                   "Legal Entity",
       hr_outl.name               "Organization Name",
       hr_outl.organization_id    "Organization ID",
       hr_loc.location_id         "Location ID",
       hr_loc.country             "Country Code",
       hr_loc.location_code       "Location Code",
       glev.flex_segment_value    "Company Code"
  FROM
       xle_entity_profiles            xep,
       xle_registrations              reg,
       --
       hr_operating_units             hou,
       -- hr_all_organization_units      hr_ou,
       hr_all_organization_units_tl   hr_outl,
       hr_locations_all               hr_loc,
       --
       gl_legal_entities_bsvs         glev
 WHERE
       1=1
   AND xep.transacting_entity_flag   =  'Y'
   AND xep.legal_entity_id           =  reg.source_id
   AND reg.source_table              =  'XLE_ENTITY_PROFILES'
   AND reg.identifying_flag          =  'Y'
   AND xep.legal_entity_id           =  hou.default_legal_context_id
   AND reg.location_id               =  hr_loc.location_id
   AND xep.legal_entity_id           =  glev.legal_entity_id
   --
   -- AND hr_ou.organization_id         =  hou.business_group_id
   AND hr_outl.organization_id       =  hou.organization_id
 ORDER BY hr_outl.name