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 :
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,361 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

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

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans