Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
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

(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
    Bipin D365 28,959 Moderator 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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,468 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,287 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans