Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

how to use method inside insert_recordset

(0) ShareShare
ReportReport
Posted on by 530

Hi,

i have example like bellow :

insert_recordset TmpTable (ID,Name,CurrentUserId)

select ID,Name, curUserId()

from SourceTable;

how i can use curUserId() in this statement just i need to take current user id in all records which is inserted into the temp table ,

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to use method inside insert_recordset

    You are using it all wrong. 

    If you want to extract user id from any table then acquire that field in "userId" EDT. 

    In your case, it looks like that you want to store the current user id in your table named TmpTable. In order to use curUserId(), you need to store it into some variable and then insert it.

    "insert_recordset" is a good way for bulk insertion but has a limitation that you cannot manipulate your data while insertion which in your case is necessary.

  • Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: how to use method inside insert_recordset

    You could get answers for majority of your questions using the MSDN documentation and various blogs, please rely on search engines more in the future.

    See example 3 for insert_recordset operation in the documentation:

    msdn.microsoft.com/.../aa635694.aspx

    You could assign it to a variable first.

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,399 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans