Sunday, September 20, 2020

What gets changed (Technical) in D365 Finance Operation with dual-write

Being a developer I have to explore how a new feature or a framework has been developed and how can this be extended when needed. While working on dual-write implementation I came across many technical difficulties as the framework was not mature enough at that time since the dual-write is only generally available in end of March 2020 and I have been working on dual-write since mid-year 2019.

I must say MS has done tremendous amount of work to make the integration with Microsoft Dynamics 365 Finance Operations apps and Common Data Services via Dual-write

Bunch of AOT objects have been added at D365 FO side - screen shot taken from 10.0.13 these can grow with future releases if needed.











Application class has also been modified for dual-write, below method gets called when the database transaction tries to get committed, between ttsbegin and ttscommit.

public void ttsNotifyPreCommit()

    {

        if (!isInTtsNotifyPreCommit)

        {

            try

            {

                isInTtsNotifyPreCommit = true;

                if (sysTransactionScope)

                {

                    sysTransactionScope.onTtsCommitting();

                }

                   

                super();

                   

                if(this.canRaiseEvent())

                {

                    this.onTtsNotifyPreCommit();

                }

 

                // Checks that all suspension of recId allocation invoked by calling appl.SysRecIdSequence().suspendRecIds() have been removed.

                if (sysRecIdSequence)

                {

                    if (!this.sysRecIdSequence().areAllRecIdSuspensionsRemoved())

                    {

                        throw error("@SYS344764");

                    }

                    sysRecidSequence = null;

               }

 

               if (this.ttsLevel() == 1)

               {

                   DualWriteChangeProcessorBase::processTransactionPrecommit();

               }

            }

            finally

            {

                isInTtsNotifyPreCommit = false;

            }

        }

    }


Dual-write triggers only at ttsLevel 1, to understand this concept I did a small test.











From the trace log I can see that before ttscommit it goes to Application::ttsNotifyPreCommit and from there is makes a call to DualWriteChangeProcessorBase and in my scenario it goes to DualWriteSyncOutbound class.

























If you dig deeper in this class, this creates the complete JSON message and sync this to CE.

In my next post, I will show what tables, entities, classes are involved and how you can see what JSON message is going out from FO to CE. Stay tune.

Error resolution: Copying pre-existing data completed with errors. For additional details, go to initial sync details tab

If you happen to face this error message "Copying pre-existing data completed with error, For additional details, go to initial sync details tab" while starting the dual-write entity map then please check you have setup the cross company data sharing policy for the underline table of the entity map (which is a data entity in D365 FO).

To resolve this issue, Go to System Administration | Setup | Configure cross=company data sharing screen and look for policy where you may have setup the underline table of the data entity used for dual-write entity map. Disable the policy and then run the dual-write job again, wait until it turns to running state. Enable the cross-company data sharing policy again choose No on the next open pop-up window otherwise it will run against all data across all legal entitles which might not be necessary for this exercise as you just disabled it to start dual-write entity map.





Source of truth for your Dual-write questions, issues discussions, and get resolutions

If you happen to stuck with any issue with the Dual-write implementation from on how and where to start with dual-write - The source of truth is a yammer group https://www.yammer.com/dynamicsaxfeedbackprograms/#/threads/inGroup?type=in_group&feedId=16038053 runs by Microsoft Dual-write product team.

FILES tab in the group contains all A-Z documentation.

Get your questions answered today by various experts including MS dual-write product team.

You can even raise your live issue with them in the yammer group and they connect with you in no time - very much useful!!

Saturday, September 12, 2020

DynamicsCon Recording - The Power of Dual Write

Excited to share that the recording of my session on "The Power Of Dual Write" is now available. 

Please watch and share your feedback.

Please feel free to ask questions - this way we all can learn more!!




How to enable new Microsoft teams - Public Preview!

New Microsoft Teams is just AWESOME, quick but useful post below shows how you have this preview feature to make your life EASY!  Open Micr...