cancel
Showing results for 
Search instead for 
Did you mean: 

Id of logged in user

Former Member
0 Kudos

Hey all.

Does anyone know how I can get the information of the current user?

I want to query the OUSR table based on the current user that is logged into the Business One client.

I use the Single sign on code for my DI application but I cannot seem to find anyway to get information about the specific user.

Accepted Solutions (1)

Accepted Solutions (1)

rasmuswulff_jensen
Active Contributor
0 Kudos

the DI's Company object hold the username since the single signon pass this data to the company object when doing the single signon...

so it should just be oCompany.Username

Answers (1)

Answers (1)

former_member184566
Active Contributor
0 Kudos

Hi Curtis

Rasmus is correct, you can do it that way. here is a sample

Public Sub CheckLoggedOnUser()

MsgBox(oCompany.UserName)

MsgBox(oCompany.UserSignature)

End Sub

but you can do it eve without sdk in a form of a query within sbo. You use the following query.

SELECT U_NAME FROM OUSR WHERE INTERNAL_K = $[USER]

But this query, you can't just execute it in query manager, it will give an error. The same as $[$10.0.number] format will give an error. Must do it from a formated search and then it will work.

Hope this helps

Former Member
0 Kudos

Hi Louis,

Do you know how can I get the ID of the logged in user just executing in Query Manager?