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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Answered

Using Insert_recordset and CrossCompany

(0) ShareShare
ReportReport
Posted on by 416

Hi Everyone,

I have a couple of question regarding the use of insert_recordset and CrossCompany . I reviewed old post and Documentation regarding the use of insert_recordset and crossCompany (https://docs.microsoft.com/en-us/dynamicsax-2012/developer/cross-company-data-modification-using-x?redirectedfrom=MSDN), and for older Dynamics AX versions it has been said that this is not allowed.  Now, if I try to perform this in D365FO, let's say an example like this one:

insert_recordset tmpTable(Number, Date, Vendor)
            select crosscompany RecId, Date
            from secondaryTable
            group by RecId, date
            where secondaryTable.Field = Value
                join Party
                from vendTable
                group by Party

I receive the followin error:

pastedimage1593210389883v1.png

CrossCompany insert_recordset Operations is allowed only for admins. 

So my questions are:

1. ¿Can we use both keywords?  - since it was being said this wasn´t allowed. 

2. If indeed we can use both keywords, is there a way to make the procedure available for role-based security (Only SysAdmins would be able to run functionality tied to those statements). 

3. Is there oficial documentation to support this?

Regards,

I have the same question (0)
  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    I just tested (under sys admin) and it works, however, you need to skip

    .skipDatabaseLog(true);
    .skipEvents(true);
    .skipDataMethods(true);

    And make sure that DataAreaId is mapped (selected from source and present in insert statement) 

    Also it does not work with tempDB tables.

    Re XDS, it should work as well, but I would recommend to test it.

  • Jonathancm Profile Picture
    416 on at

    Thank you, it worked as you said. I will test the XDS, because I think it is still not working without sysAdmin. 

    Edit:

    - Insert_recordset and CrossCompany works as described by ievgen.

    - I haven´t been able to run the statement without SysAdmin (Same error thrown in first post). Seems like it is enforced by the "kernel".

      

    Kind Regards,

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 303 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 122 Super User 2025 Season 2

#3
Siv Sagar Profile Picture

Siv Sagar 105 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans