Monday, 7 April 2014

SQL to get form folder details of all users

#=======================================================================
# Writer          : Lokanadham Thandlam
#=======================================================================
Different Oracle users might access folder forms using their own personalized folder.
We might need to know which user has access to certain folders and also which columns are included in the folders.

-- View the folders, the users to which the folders belong to
-- and the columns included in the folders

SELECT ff.folder_id,
       ff.OBJECT "View Name",
       ff.NAME "Folder Name",
       ff.where_clause,
       fu.user_name,
       ffc.item_name,
       ffc.item_prompt
  FROM fnd_folders ff,
       fnd_default_folders fdf,
       fnd_user fu,
       fnd_folder_columns ffc
 WHERE     ff.folder_id = fdf.folder_id
       AND fu.user_id = fdf.user_id
       AND ffc.folder_id = ff.folder_id

       AND fu.user_name = NVL (upper(:user_name), fu.user_name)