Saturday 13 July 2019

CROSSCOMPANY AND CHANGECOMPANY IN D365 AX 7 DYNAMICS CODE

CROSSCOMPANY AND CHANGECOMPANY IN D365 AX 7 DYNAMICS CODE

Cross-Company Data Modification Using X++

X++ example uses the forUpdate keyword on the while select crossCompany statement. Only one table buffer variable is declared. This example also uses the update method on the table buffer.

In order to use crosscompany or changecompany in d365 use the following code .
static void JobCCForUpdMethod( Args _args )
    {
        Table21 tab21;
        ;
        ttsBegin;
        while select
            forUpdate crossCompany
                countOfReviews
            from
                tab21
        {
            changeCompany( tab21 .dataAreaId )
            {
                tab21 .countOfReviews = tab21 .countOfReviews + 2;
                tab21 .update();
            }
        }
        ttsCommit;
    }


the above code is taken from here

No comments:

Post a Comment

AZURE INTERVIEW QUESTIONS AND ANSWERS

AZURE INTERVIEW QUESTIONS AND ANSWERES 2021 2. What is cloud computing? Explanation:  It is the use of servers on the internet to “store...