Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

Bug Report - 9.0.12.4 - Update of Account via SDK causes "Invalid State Code" error on expired contracts

Posted on by 10

CRM Version 9.0.12.4 On Premise
 
To reproduce:
1. Find an Account that is the Customer on an expired contract
2. Using the SDK, retrieve the account record, change any field on the record - e.g. set the "Description" field to "test"
3. Update the record via the SDK
4. You get a "Contract state invalid error"

... something like this:
var account = orgContext.Retrieve("account", id, new ColumnSet(true)).ToEntity<Account>();
account.Description = "test";
orgContext.Update(account);

5. If you update the field using the CRM UI (Account form) then you do NOT get an error (which is unsettling!)

We have a server that is on version 9.0.2.3034, and when we run the same update code against that environment, we do not see the error - so the bug was introduced between 9.0.2.3034 and 9.0.12.4

Additionally, if we change the relationship type of the Contract's Customer-Account related property from "Parental" to "Cascade" the error stops happening, so it seems to have something to do with the parental relationship between the account record and the contract record - it should not be trying to update expired contracts.

Thanks!

  • Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Bug Report - 9.0.12.4 - Update of Account via SDK causes "Invalid State Code" error on expired contracts

    Hi,

    I would recomment you to submit support ticket to microsoft.

    If found helpful, Please mark my answer verified.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans