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 :
Microsoft Dynamics CRM (Archived)

Status Reason Values

(0) ShareShare
ReportReport
Posted on by

Hi,

We are using ClickDimensions Events and created a unmanaged solution to change fields.

For the Status Reason (aka statuscode) field, we created scheduled (instead of Active) and Deactivated (Instead of Inactive) to avoid confusion among users since the Status (aka statecode) field also has Active/Inactive. However after deleting the Active/Inactive from Status Reason, we are now getting errors in the application and even in any events (ClickDimensions Entity) that had a reference to it.

Can't even access the Status Reason field to change it back.

6013.error.JPG

Is there a way to restore these status reasons Active/Inactive ?

*This post is locked for comments

I have the same question (0)
  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Did you actually delete the Status Reasons or Rename (change the label) them?

  • Verified answer
    Rawish Kumar Profile Picture
    13,758 on at

    Hi Gagandeep,

    is it possible for you to get a solution from other environment including this field and import it to this organization.

  • Community Member Profile Picture
    on at

    We created the new ones and deleted the existing ones.

  • Community Member Profile Picture
    on at

    You mean the unmanaged solution or the default one by MS ?

    We are configuring our sandbox environment.  That's where we deleted the status reason values.

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    That is most likely the problem, as the number (codes) for the Status Reasons are not incorrect and what is causing this issue. If you have the ability to reimport those fields (OOB) from a DEV environment that would be the best (as Rawish mentioned above).

    If not, you can possibly change the values of the existing fields (not sure what the original ones are) using the following code (in a C# console application):

           private void InsertStatusReasonValue(string entityLogicalName, int stateCode, int statusCode, string label)

           {

               InsertStatusValueRequest insertStatusValueRequest = new InsertStatusValueRequest

               {

                   AttributeLogicalName = "statuscode",

                   EntityLogicalName = entityLogicalName,

                   Label = new Label(label, 1033),

                   Value = statusCode, // integer value of current State Code

                   StateCode = stateCode // integer value of new Status Code

               };

               int _insertedStatusValue = ((InsertStatusValueResponse)service.Execute(insertStatusValueRequest)).NewOptionValue;

           }

    This way you can reset the status code to the correct value, but first you need to find out what they are.

    EDIT: One more thing. Your status codes are most likely Active = 1 and Inactive = 2, as these are the default values for most Status Reasons (codes)

    Hope this helps.

  • Community Member Profile Picture
    on at

    Thanks Aric,

    I came across another post that mentioned the same thing.

    The only issue remaining now is how to get the default values of the status codes we deleted.

    Will try 1 and 2 see if it works.

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Not sure which entity this is for, but the default ones are Active (1), and Inactive (2). Usually they are not modified.

    If you need to change these after you fix the issue, I would just rename the existing ones.

  • Community Member Profile Picture
    on at

    Thanks Aric and Rawish.

    We created an unmanaged solution in the PROD (still out of the box) and just added the Events entity with the default Status Reason values and imported in our Sandbox. That seems to have somehow fixed the issue for now.

    Even though we were expecting to see Active/Inactive, it shows the customized values(Scheduled/Deactivated) but is working fine and we are able to open the field and also the events seem to be working fine.

  • Rawish Kumar Profile Picture
    13,758 on at

    Glad it worked :)

    would you mind closing this thread then by marking suggestions as verified so that it can help others.

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans