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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Updating Status and Status Reason via Data Import

(0) ShareShare
ReportReport
Posted on by

Hi there,

We've performed an install of CRM Online (i.e. 2015) and have been adding in data from a previous 2013 on-premises instance, now we're trying to update a lot of Orders so that they show the correct Status/Status Reason pairings. I'm using the functionality to Export to Excel, make changes and then re-import the data.

However, the import file contains a lot of errors saying: "State code is invalid or state code is valid but status code is invalid for a specified state code." The error code is always 0x80048408, and the More Information shows: "100001 is not a valid status code for state code SalesOrderState.Active on salesorder with Id [GUID]."

Both the status and status reason are contained in the import file, and I would like the status to be set to 3 (Fulfilled) and status reason to 100001 (Complete). Which are both valid in the 2015 instance.

I've already done a few internet searches on the best way to achieve this, and the feedback seems to be that this is difficult to do via the ETL process. What are the other options? Any advice?

Thanks,

Nick.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Aiden Kaskela Profile Picture
    19,696 on at
    RE: Updating Status and Status Reason via Data Import

    Hi Nick,

    I've struggled with this myself and don't have a helpful way to do it through the import wizard. It is straightforward to do through the SDK though, and if it's a one-time update then that may be the way to go.

    You'd want to get a list of the Orders that you want to update, and loop through it with a specialized request for sales orders like this:

    FulfillSalesOrderRequest request = new FulfillSalesOrderRequest();
    request.OrderClose = new Entity("orderclose");
    request.OrderClose["salesorderid"] = new EntityReference("salesorder", orderId);
    request.Status = new OptionSetValue(100001);
    service.Proxy.Execute(request);

    Hope this helps solve get you to where you want to be. If it's helpful, I would appreciate if you would please mark this as the verified answer.

     

    Thanks,

      Aiden

  • Community Member Profile Picture
    on at
    RE: Updating Status and Status Reason via Data Import

    That's great! I passed the code onto one of our devs and after a morning, we have properly updated the Orders.

    Thanks for the advice ;)

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans