Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Unanswered

How to copy one Company data to Another Company Using X++

Posted on by 420

Hi,

I need to Copy One Company Data to Another company for example I have '' table A " and Companies A and B , I have to copy the A Company Data to B Company. I need x++ code samples to do this. Help me on this.

Regards,

Ram

  • Suresh M. Parmar Profile Picture
    Suresh M. Parmar 340 on at
    RE: How to copy one Company data to Another Company Using X++
    Hi Ram,
    By using changeCompany() method it can be possible.
    Here is the code example
    //Get the company A record from table A
             
    while select tableA
    {
    changecompany(B)
    {          
       tableALoc.clear();
       tableALoc.fieldName = value;   
       tableALoc.insert();
    }
    }
  • Martin Dráb Profile Picture
    Martin Dráb 225,490 Super User on at
    RE: How to copy one Company data to Another Company Using X++

    Before writing any code, did you consider the existing solution to Copy data between Dynamics AX companies?

    If you decide that writing custom code is necessary, you may need changeCompany statement.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans