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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Create Salesorder Entity with different status Rather than New

(0) ShareShare
ReportReport
Posted on by 59

Hi,

I import salesorder with xml or csv data import with status different than new which i assign its new value at salesorder precreate(i know i can assign the status at data import wizzard but that's not what i need.the status can be changed by some logic that's why i should run plugin for it.).But it creates the entity with status "new".Then i updated entity after creation with the wanted status then it works.Can't i create salesorder with status different than "New"even i assign new value to it on pre-create?.I tried initializing new values to statecode and statuscode on pre-create but it didnt work.Only updating after post create worked.

Do i know something missing?Or it is just managed by CRM when creating new salesorder entity that we cant set different status than "New".

Thanks.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Ammar Zaied Profile Picture
    1,670 on at

    Hi Eomer,

    you can create your Options Set/Picklist and change the default picklist in sales order.

    Create custom option set

  • Suggested answer
    Kokulan Profile Picture
    18,054 on at

    Hi

    You can create an Order with any Active Status reason, for example, you could create with the Pending status, see below

    Entity salesOrder = new Entity("salesorder");
    salesOrder["name"] = "Test Order with Pending status reason";
    salesOrder["statuscode"] = new OptionSetValue(2);
    OrgService.Create(salesOrder);

    7624.ScreenClip-_5B00_195_5D00_.png

    The following are Order OOB statuses and status reasons

    7624.ScreenClip-_5B00_195_5D00_.png

  • Eomer Al. Profile Picture
    59 on at

    we have more than New and Pending statusecodes for active status.We added them by ourselves.i think that's why we cant create with this custom status options.

    we can create only active with "New" or "Pending" statuses?Because i tried many times to create with active and custom statuscodes but it overrided

    salesOrder["statuscode"] = new OptionSetValue(customvalue); and created entity with "New" status.So i got over this with updating entity after post create .

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
RichardM Profile Picture

RichardM 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans