Skip to main content

Notifications

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 532

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
    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
    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

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,296 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,093 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans