Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Diverging information on CDS

(0) ShareShare
ReportReport
Posted on by

Hi We have a production environment in Dynamics 365, where we are having a scenario that we cannot identify what is happening:

When consulting some opportunities that are already won or lost, in the CDS the field of actualclosedate is null, however when accessing the form in CRM there is information in the field.

Has anyone faced a situation like this, where CDS data is different from CRM? CDS: Commom Data Service

Thanks

  • Suggested answer
    LuHao Profile Picture
    40,888 on at
    RE: Diverging information on CDS

    Hi Matheus,

    We can choose the effect of its work through the scope of business rules.

    If you want business rules to run only in the background and not on the form, then we need to select the scope as the entity.

    If the scope is all forms or a certain form, then this business rule will only work when the user accesses the form.

    pastedimage1608172109419v1.png

  • Community Member Profile Picture
    on at
    RE: Diverging information on CDS

    Hi Lu Hao

    I checked as you advised and there really is a business rule created as follows:

    If Status (StateCode) equals "Gain, Lose"

    Then Set Actual Closing Date (actualclosedate) as Modified Date

    But these opportunities are not open, so they should have the correct closing field.

    Do you have any suggestions on how we can fix it?

    We have another case where a field that we create is calculated according to another field, ex:

    If field A <55 then field B = 'No Forecast'

    If field A> = 55 and <= 65 then field B = 'Alert'

    If field A> 65 then field B = 'In Forecast'

    However, when consulting the CDS of some opportunities, the value is different, as well as in the view. However, when entering the opportunity form, the value of field B is correct. And a few seconds after entering the form, the field on the CDS is corrected and the change is recorded in the opportunity audit. I understand that this is due to the business rule, but the data was only correct if it enters all opportunities. Is there any way to program the business rule to run without accessing the form, automatically?

    Thank you for your help.

  • Suggested answer
    LuHao Profile Picture
    40,888 on at
    RE: Diverging information on CDS

    Hi Matheus,

    It may be because business rules or Javascript related to the actualclosedate field are applied on the form. We need to check them both.

    1. Business Rules

    Go to Customizations, expand Entities > Opportunity > Business Rules, open all business rules in turn and check whether there is a Set Value step for the actualclosedate field.

    pastedimage1607654570551v1.png

    pastedimage1607654683139v2.png

    2. Javascript 

    According to your description, the actualclosedate field contains data when the form is opened, so it should be caused by the OnLoad event.

    Open the form editor of Opportunity main form, click Form Properties, edit an OnLoad event every time and disable it, then save and publish the form. Go to D365 to check whether the actualclosedate field in the form contains data, if it still contains data, disable the next OnLoad event in the form editor then save and publish form. Repeat this step until the actualclosedate field in the D365 form is empty, then the root cause is the last disabled OnLoad event.

    pastedimage1607655020328v3.png

  • Community Member Profile Picture
    on at
    RE: Diverging information on CDS

    Hello Lu Hao, thanks for the reply.

    I checked the points you mentioned and point 2 happened as you described.

    I created a view with the actual closing column and when filtering the opportunity, the column appears empty in the view and when entering the opportunity, in the form the field contains value.

    Do you have any suggestions as to how we can verify why this is happening?

    Tks

  • LuHao Profile Picture
    40,888 on at
    RE: Diverging information on CDS

    Hi Matheus,

    1. Please confirm whether the environment in CDS matches D365 environment .

    2. In addition to the D365 form, you can also add the actualclosedate column to a view, and then check the actualclosedate value in the view. Because there may be business rules or Javascript on the form to change the field value.

    3. Please compare the data in D365 with the data in CDS on the same Opportunity record. There may be two Opportunities with duplicate names.

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Product updates

Dynamics 365 release plans