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)

Getting error when fulfill the order in Mobile Client(Unified User Interface)

(0) ShareShare
ReportReport
Posted on by

Hi,

I am getting following error when I fulfill the order in Mobile Client(Unified User Interface). However, it is working fine Web.
1- We have created a plugin which verify few things before SalesOrder get fulfilled or canceled.
2- We have created a plugin which enter data to other entities after SalesOrder get fulfilled or canceled.

Error Message: "This message can not be used to set the state of SalesOrder to Fulfilled. In order to set state of SalesOrder to Fulfilled, use the FulfillSalesOrderRequest Request message instead."

Version: MS Dynamics 365, v9.0

Please suggest

*This post is locked for comments

I have the same question (0)
  • RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: Getting error when fulfill the order in Mobile Client(Unified User Interface)

    Hi Chhaya,

    Have you changed your code as suggested above i.e. instead of chaing the status directly use fullfillsalesorder request message? Could you please share some more details from where you are setting the status? Are you saying that you are getting the same error message from UI?

  • Community Member Profile Picture
    on at
    RE: Getting error when fulfill the order in Mobile Client(Unified User Interface)

    Hi Ravi,

    I just noticed that it throws same error even if I remove plugin. I have tried with another blank trial account. It throws same error.

    Can you please suggest? Is it error of CRM itself?

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    7,755 on at
    RE: Getting error when fulfill the order in Mobile Client(Unified User Interface)

    On which message you have registered plugin?

    It will be helpful if you share your code. Thanks

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: Getting error when fulfill the order in Mobile Client(Unified User Interface)

    Hi Chhaya,

    It doesn't seem right that the plugin is failing only for UI interface because plugin executes server side and it doe not matter from where the action is performed (i.e. web, UI, web resource, console app etc).

    With that said, it is possible that you may have some condition in you rplugin which only satisfy when you create the record from UI. Nevertheless, the error in question is expected if you simply set the state to close the salesorder instead you need to use a FulfillSalesOrderRequest .

    Here is the sample code-

    ===========

    using (service = new OrganizationServiceProxy(new Uri(_organizationURI), null, _credential, null))

               {

                   var entityId = new Guid("2F250019-4968-E711-811B-E0071B67AC81");

                   var entityName = "salesorder";

                   var targetEntity = service.Retrieve(entityName, entityId, new ColumnSet(true));

                   Entity erOrderClose = new Entity("orderclose");

                   erOrderClose["salesorderid"] = new EntityReference("salesorder", targetEntity.Id);

                   FulfillSalesOrderRequest req = new FulfillSalesOrderRequest();

                   req.OrderClose = erOrderClose;

                   req.Status = new OptionSetValue(100001);

                   FulfillSalesOrderResponse response = (FulfillSalesOrderResponse)service.Execute(req);

               }

    ==========

    Hope this helps.

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
HR-09070029-0 Profile Picture

HR-09070029-0 2

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans