web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

Set current user name as default value to textbox

(0) ShareShare
ReportReport
Posted on by

Hi All,

         I am using SL2011. In Journal Transaction screen , I have added a new Custom Field(batch.user5). How can I get the current user name to the custom field who has been logged in by changing the default property?

 In default property i have tried by using the below values:
0; "bpes.UserId"; 0; 0; 0
If i use the above values on the properties i am getting "0;" in the custom field. 

But through below VBA coding i am able to get the Current user name and set this value to default :

Private Sub xuser1_Default(OldValue As String, retval As Integer)
Dim strUserId As String
Call GetBufferValue("bPes.UserId", strUserId)
Call SetBufferValue("BBatch.user5", strUserId)
Call SetObjectValue("xuser1", strUserId)
Call DispFields("form1", "xuser1")
End Sub

 Kindly please guide me Why i am not able to get the current user name by changing the default property of custom filed?

 

 

 

*This post is locked for comments

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans