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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

data couldn't update while update record set for crosscompany

(0) ShareShare
ReportReport
Posted on by 4

I want to update crosscompany data using update record set . I tried this below code, but it doesn't work.

TempTable.skipDataMethods(true);

TempTable.skipDatabaseLog(true)
;
TempTable.skipEvents(true);

update_recordSet crossCompany
TempTable
setting vendPackingSlipJour = vendPackingSlipJour.RecId,
vendPackingSlipTrans = vendPackingSlipTrans.RecId

join recId from vendPackingSlipJour
        where vendPackingSlipJour.PackingSlipId == TempTable.PackingSlipId
        && vendPackingSlipJour.DeliveryDate == TempTable.DatePhysical
join recId from vendPackingSlipTrans
      where vendPackingSlipTrans.VendPackingSlipJour == vendPackingSlipJour.RecId
      exists join inventTransOrigin;
where inventTransOrigin.InventTransId == vendPackingSlipTrans.InventTransId
&& inventTransOrigin.RecId == TempTable.InventTransOrigin
I have the same question (0)
  • Suggested answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Siddy,

    Cross company does not work with update_recordset. Please check this thread -

    community.dynamics.com/.../using-crosscompany-with-update_recordset

  • WillWU Profile Picture
    22,363 on at

    Hi Siddy Mujumdar,

    As mentioned above, you cannot use the crossCompany keyword in X SQL statements that modify data.

    I rewrote your code, please try it.

     while select crossCompany TempTable
                join vendPackingSlipJour where vendPackingSlipJour.PackingSlipId == TempTable.PackingSlipId
            && vendPackingSlipJour.DeliveryDate == TempTable.DatePhysical
                join vendPackingSlipTrans where vendPackingSlipTrans.VendPackingSlipJour == vendPackingSlipJour.RecId
          exists join inventTransOrigin  where inventTransOrigin.InventTransId == vendPackingSlipTrans.InventTransId
                && inventTransOrigin.RecId == TempTable.InventTransOrigin
    
                if(TempTable)
            {
                TempTable.selectForUpdate(true);
                ttsbegin;
                TempTable.yourfield="yourfield";
                TempTable.update();
                ttscommit
            }

    Refer to :https://docs.microsoft.com/en-us/dynamicsax-2012/developer/cross-company-data-modification-using-x

  • Suggested answer
    mhdshb1 Profile Picture
    1,250 on at

    Hi Siddy,

    In addition to what is mentioned, you can refer to this link

    docs.microsoft.com/.../cross-company-data-modification-using-x

    Regards,

    M

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 658

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 495 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 315 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans