Skip to main content

Notifications

Announcements

No record found.

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
  • Suggested answer
    mhdshb1 Profile Picture
    1,250 on at
    RE: data couldn't update while update record set for crosscompany

    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

  • WillWU Profile Picture
    22,352 on at
    RE: data couldn't update while update record set for crosscompany

    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
    Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: data couldn't update while update record set for crosscompany

    Hi Siddy,

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

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

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

#2
Martin Dráb Profile Picture

Martin Dráb 232,002 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans