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

Update SalesLine table on the moment of creation of intercompany sales order D365Fo X++

(0) ShareShare
ReportReport
Posted on by 152

Hello all,

I have a custom field on Sales Line  on Company X.

On the moment of creation of Inter company sales order on company Y, i want this field on company Y(which is the intercompany salesorder)  to be same as original...so same as company X. 

On what class can i do that and how? How to catch the value of salesline on company X and the value of salesline on inter company Y? I am using D365fo

Thank you in advance.

I have the same question (0)
  • Suggested answer
    ergun sahin Profile Picture
    8,826 Moderator on at

    Here a article for Header

    allaboutdynamic.com/.../

    I think for lines you must look for; InterCompanySyncPurchLineType

    Maybe this can be helpfull

    rahulmsdax.blogspot.com/.../object-reference-not-set-to-instance-of.html

  • PaulaRystemi6 Profile Picture
    152 on at

    Hi Ergün,

    Thank you for your answer.

    The solution on blog was :

    [ExtensionOf(classStr(InterCompanySyncPurchLineType))]

    final class SWInterCompanySyncPurchLineType_Extension

    {

       protected void synchronizeInTradeCompany()

       {

           next synchronizeInTradeCompany();

           AxSalesLine axSalesLineLocal = this.axSalesLine;

           if (create || purchLine.fieldChanged(fieldNum(PurchLine, InventDimId)))

           {

               axSalesLineLocal.axInventDim().productDimensions(axInventDim);

               changecompany (purchLine.company())

               {

                   this.copyPurchaseBatchNumberToSalesTable(purchLine);

               }

           }

       }

    }

    My field is on salesLine, and needs to be updated on salesline of intercompany too, and its custom. Should all those conditions above be the same even on my case?

  • Suggested answer
    ergun sahin Profile Picture
    8,826 Moderator on at

    In the case of Rahul, he wants to send the value of a different purch to sales in intercompnay. For this reason, it switches to the original purch's company. Rahul has not shared it, but will probably take the value from the second purch in the copyPurchaseBatchNumberToSalesTable method and write it to the intercompany sales.

    In your case, you don't need to change companies with crossCompany if the sales are in the same company.

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 551 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans