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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

statecode cannot be set to NULL error when submitting a case via the Portal

(0) ShareShare
ReportReport
Posted on by 42

We use a PowerApps portal for end users to submit cases to IT.  This has worked fine until a couple of nights ago.  Now when people attempt to submit a case (fill out all required fields and click submit), they get a banner error stating "Attribute: statecode cannot be set to NULL" and the case is not saved.  The only change I made to the system was to add a new Status Reason (statuscode).

We've tried the following:

  1. Deleted the new Status Reason choice value
  2. Use the Portal Management --> Basic Forms --> Customer Service - Create Case --> Entity Form Metadata settings to manually force StateCode to 0 (Active)
  3. Created a new form to use to create cases
  4. Restarted the Portal
  5. Cleared the portal cache using the /_services/about page
  6. Cleared the Config using the /_services/about page
  7. used different browsers and different logins

We can manually create cases using the same form through the CRM UI, using other forms in the CRM UI, using D365 for Outlook add-in, using email to Case automatic record creation (although only some people in the company are allowed to use that).  Nothing seems to help.  We have no custom plugins registered, there are no offending business rules, and no failed system jobs.

I'm at a loss.

Any help is appreciated.

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi 

    As you mentioned, "add a new Status Reason (statuscode)",I have some questions about this:

    Which means that you add OOB Status Reason field to the form--Web - Create Case, or create a new custom field?

    And why do you want to add the field?

    pastedimage1630900802309v1.png

    I have added OOB status reason field to the web-create case form, which just show label and can't be edit in the portal.

    pastedimage1630901025519v3.png

    Also, i can submit the case successfully and there are no any errors appear.

    pastedimage1630901122140v4.png

  • JinsengIT Profile Picture
    42 on at

    Leah,

    I added a value to the Status Reason field (so we can use it internally while working a case), but did not add the field to the form.  That's what makes this so strange; we didn't change anything on the Web-Create Case form (or make any changes to the portal at all).  Microsoft thinks it has something to do with the validforcreateapi property of the statecode field in the case entity being false in the Active solution layer.  They suggested I edit that or delete the active solution layer.  I wasn't able to find out how to edit it, so I deleted it.  Now the highest solution layer has the property set to validforcreateapi set to true and we still have the same issue.

    pastedimage1630902610243v1.png

  • Suggested answer
    JinsengIT Profile Picture
    42 on at

    I'm still trying to get more root cause information from Microsoft, but what I've found so far is that the statecode field somehow got added to or set to visible on the form used to create new cases via the portal (Web - Create Case).  This was not one of the changes I made last week, so I don't know how this happened.  Hiding that field fixed the issue, and then I later removed the field completely as I suspect it was not originally on the form.

  • Community Member Profile Picture
    on at

    Hi JinsengIT,

    As you suspected, OOB Web - Create Case form does not contain the statecode field.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 137 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans