我在crm 2013中为订单履行编写了以下代码。
FulfillSalesOrderRequest req = new FulfillSalesOrderRequest();
req.OrderClose = new Entity();
req.OrderClose.LogicalName = "salesorder";
req.OrderClose.Id = pSalesOrderId;
OptionSetValue o = new OptionSetValue();
o.Value = 100001;
req.Status = o;
FulfillSalesOrderResponse resp = (FulfillSalesOrderResponse)_service.Execute(req);
但秩序没有实现。
如果我遗失了什么,请帮帮我吗?
答案 0 :(得分:1)
OrderClose
属性为orderclose
,而不是salesorder
。此外,您需要设置SalesOrderId
属性
尝试使用此代码(假设您的状态值有效)
FulfillSalesOrderRequest req = new FulfillSalesOrderRequest();
req.OrderClose = new Entity("orderclose");
req.OrderClose["salesorderid"] = new EntityReference("salesorder", pSalesOrderId);
req.Status = new OptionSetValue(100001);
FulfillSalesOrderResponse resp = (FulfillSalesOrderResponse)_service.Execute(req);