Skip to main content

Notifications

Announcements

No record found.

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

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,245 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,925 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans