web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Active Discussion

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

(0) ShareShare
ReportReport
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
    28,985 Moderator on at

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#2
ManoVerse Profile Picture

ManoVerse 55 Super User 2026 Season 1

#3
11manish Profile Picture

11manish 37

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans