0
我使用OrganizationServiceClient
與CRM 2011
創建使用OrganizationServiceClient手動折扣發票明細,當我創建一個invoicedetail
有manualdiscountamount
,折扣不會出現在CRM website
。 這裏是我的代碼:不能在2011年CRM
OrganizationServiceClient client = new OrganizationServiceClient("CustomBinding_IOrganizationService",new EndpointAddress(AuthenticationInfo.OrganizationServiceUrl))) { client.ConfigureCrmOnlineBinding(AuthenticationInfo.OrganizationPolicy.IssuerUri);
client.Token = AuthenticationInfo.OrganizationToken;
Entity entityDetails = = new Entity();
entityDetails.LogicalName = "invoicedetail";
entityDetails.Attributes = new AttributeCollection();
entityDetails.Attributes.Add(new KeyValuePairOfstringanyType() {
key = "productid",
value =
new EntityReference() {
LogicalName = "product",
Id = Guid.Parse("Some Product Id")
}
});
entityDetails.Attributes.Add(new KeyValuePairOfstringanyType() {
key = "uomid",
value =
new EntityReference() {
LogicalName = "uom",
Id = Guid.Parse("33B75DB8-8771-4B5A-875F-810CC0732C0C")
}
});
entityDetails.Attributes.Add(new KeyValuePairOfstringanyType() {
key = "invoiceid",
value = new EntityReference() {LogicalName = "invoice", Id = Guid.Parse("Some Invoice Id")}
});
entityDetails.Attributes.Add(new KeyValuePairOfstringanyType() {
key = "quantity",
value = 1
});
entityDetails.Attributes.Add(new KeyValuePairOfstringanyType() {
key = "createdon",
value = DateTime.Now
});
entityDetails.Attributes.Add(new KeyValuePairOfstringanyType() {
key = "manualdiscountamount",
value = 15
});
invoiceDetailsId = client.Create(entityDetails);
什麼可以在這裏是什麼問題?
它的工作,解決了我的問題。謝謝。 – Saied