I\'m trying to build a plugin that does some operations on a salesorder. I also have to set a order as fulfilled. I found on the SDK documentation an extract that must be us
That is an early bound request, that's why you can't compile, if you aren't using the CrmScvUtil.
This is an example of a late bound request:
This namespace is needed.
using Microsoft.Xrm.Sdk.Messages;
And this is the code.
var request = new FulfillSalesOrderRequest();
request.OrderClose = new Entity("orderclose");
request.OrderClose["salesorderid"] = new EntityReference("salesorder", new Guid("YOURGUID"));
request.Status = new OptionSetValue(100001);
service.Execute(request);
100001
is the status code for Complete.
If you want to handle the response, use a variable to receive the answer.