cancel
Showing results for 
Search instead for 
Did you mean: 

Find Current User Name and Code in B1 Application

Former Member
0 Kudos
1,612

Hi,

i need for my present Company the logged user in B1,e.g. when i log in with manager/manager, in which table i can see that i logged in with this user.

Regards,

Benjamin Rosary.B

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi..

use this code

Public Sub New()

MsgBox(oCompany.UserName)

MsgBox(oCompany.Password)

MsgBox(oCompany.CompanyDB)

End Sub

Regards...

billa 2007

Former Member
0 Kudos

hi,

OCompany1 = New SAPbobsCOM.Company

OCompany1.Server = ServerName

OCompany1.language = SAPbobsCOM.BoSuppLangs.ln_English

OCompany1.UseTrusted = True

OCompany1.CompanyDB = CompanyDB '"gold"

OCompany1.UserName = UserName

Here username is nothing but user log in name.as ur eg this is manager

regards,

Avijit

Former Member
0 Kudos

Dear BENJAMIN ROSARY,

You could display the current user name by follwoing steps:

1. create a query and save it:


SELECT T0.U_NAME FROM OUSR T0 WHERE INTERNAL_K = $[USER] 

2. By Formatted Search to attach above query into a User Defied Field

Then the current user name will display in the UDF.

Best Regards

Jane Jing

SAP Business One Forums team

Former Member
0 Kudos

Benjamin,

for finding which is the currently logged in user,

you can find it with DI company object.


MsgBox(oCompany.UserName)
MsgBox(oCompany.UserSignature)

where oCompany is your DI company object.

regards,

Binita

Former Member
0 Kudos

yes. I know it is in ousr table . I need to find current user code. In Which table it is stored?

Regards,

Benjamin

Former Member
0 Kudos

In AUSR table there is a LastLogin column. Hope this helps.

But to get the currently logged in user using the company object is the best thing to use as Binita said.

Hope it helps,

Vasu Natari.

Edited by: vasu natari on Sep 1, 2008 7:59 AM

Former Member
0 Kudos

Hi,

Use the OUSR table.

Reagrds,

Vasu Natari.