Cross company records Ax 4.0

Get our Free Newletter

Don't you have the time to be online here at DUG every day? So how do you follow what is going on in the Dynamics industry and community?
If you subscribe to the DUG Newsletter then you can relax! We will make sure that you don't miss the big news!

Check out our
Newsletter Subscription Center
page a complete list of our different newsletters.

Solution (Verified) This post has 1 verified solution | 1 Reply | 1 Follower

102 Posts
1,120 Points
Joined: 2011-12-6
Last Online:
2013-6-19 15:04
Location: Banglore
Raghavendra posted on 2012-9-3 8:21

Hi All, 

         I want to get item id for all the companies. How can I get different company records in Ax 4.0.

Please help,

 

Thanks,

   Ragahv.

Solution (Verified) Verified Solution

102 Posts
1,120 Points
Joined: 2011-12-6
Last Online:
2013-6-19 15:04
Location: Banglore
Solution (Verified) Raghavendra replied on 2012-9-3 9:48
Verified by Raghavendra

 

I found the solution.  loop through 'DataArea' table and user changecompany() method. Under this loop through inventTable and fetch the records.

 

 

    while select dataArea where  dataarea.isVirtual == NoYes::No

    {

        changeCompany(dataArea.id)

        {

            i = 0;

            inventTable = null;

            while select inventTable where inventTable.ItemType == itemType::Service

            {

                info(strfmt("%1 %2 ",inventTable.ItemId,dataArea.id));

                i++;

            }

        }

        info(strfmt("%1", I));

    }

 

Page 1 of 1 (2 items) | Get this RSS feed | Bookmark and Share