How to get current logged in user in Oracle Fusion Cloud

There are scenarios when we need to get the current user logged in oracle fusion hcm ERP or SCM applications and we may want to do further processing related to the current user.

So there are a few ways , lets discuss

Get current logged in user for passing to external url

When you are logged in Oracle Fusion cloud and want to call external url with paramter as user name

you can write a custom java script and use the bindings parameters

#{webCenterProfile[securityContext.userName].firstName}

You can use this EL Expression To Get Current Logged In User in Fusion

#{securityContext.userName}

Write a Custom BIP query expose the report as web service

get_current_logged_in_users_oracle_fusion

This SQL query shows all the users who are currently logged in to the instance.

SELECT 
pu.username "LOGIN_USERNAME",
        pu.SUSPENDED,
 	pu.creation_date, 
        max(fs.LAST_CONNECT) "LAST_CONNECT",
max(fs.LAST_UPDATE_DATE) "LAST_UPDATE_DATE"

   FROM per_users pu,
        FND_SESSIONS fs
  WHERE 
    1=1
    AND pu.user_guid  = fs.user_guid
    AND trunc(fs.LAST_CONNECT)=trunc(SYSDATE) 

GROUP BY 
  pu.username,
  pu.SUSPENDED,
  pu.creation_date

ORDER BY pu.username DESC

Showing the user name in a BIP report

Use the session variable and add to the BIP RTF

VALUEOF (NQ_SESSION.”USER”)

Use the SQL query to create a data model and fetch the user running the report.

select * from PER_USERS where upper(USERNAME) = upper(:xdo_user_name)

How to get the email address of the current user in OTBI Analysis?
 

1) Go to OTBI / Analytics
2) Navigate to the report
3) Edit the report and go to Criteria tab
4) Add a filter on a column by using session variable filter – USER

See this example:

SELECT

“Employee”.”Employee Login Name” saw_0,

“Employee”.”Employee Email Address” saw_1,

“Employee”.”Employee Name” saw_2,

“Sales Account Resource Facts”.”# of Sales Account Resource Roles” saw_3

FROM

“Sales – CRM Sales Account Resource” WHERE “Employee”.”Employee Login Name” = VALUEOF(NQ_SESSION.”USER”)

How to pass the current logged-in username from Fusion to an external url using EL expression?

Replace the hardcoded username with #{securityContext.userName} in the URL

Steps :

  1.  Login to fusion
  2.  Create and Activate a new sandbox
  3.  Go to Navigator > Structure
  4.  Click on ‘Create’ and select ‘Create Page Entry’
  5.  Fill the inputs as per your requirement.
  6.  Enter external URL of your choice in ‘Destination’ as shown in below screenshot.  

            Ex : https://www.google.co.in/search?q=#{securityContext.userName}

        7. Test the changes by clicking on the newly created page.
        8. You will be navigated to External site with the current logged in user name in the URL.

more fusion apps tech

wpsbutton
We will be happy to hear your thoughts

Leave a reply

Cloud Technologies Blog
Logo
Enable registration in settings - general
Compare items
  • Total (0)
Compare
0
Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
Best Wordpress Adblock Detecting Plugin | CHP Adblock
Shopping cart