Acumatica CustomFields 不适用于销售订单创建
Acumatica CustomFields not working on sales order create
我正在通过 ASP.net 进行 Acumatica 集成,通过基于 API 的合同在 Acumatica 中创建销售订单。我正在使用 5.30 版。有些字段是 Acumatica 对象的标准字段,有些则不是。对于那些不存在的,我看到了一种使用 CustomFields 属性 的方法 ,您可以在创建销售订单时将数据添加到这些字段。这对 SalesOrder 对象非常有效,但是,当我在 Contact 对象上尝试时,它不起作用。我正在尝试更新销售订单的运输设置选项卡上的 "Attention" 字段。您可以在下图中看到该字段映射到 "Salutation" 数据字段。
我尝试通过 CustomFields 属性 更新此字段,但它不起作用:
orderToBeCreated = new SalesOrder
{
OrderType = new StringValue { Value = "SO" },
CustomerID = new StringValue { Value = customerID },
Description = new StringValue { Value = orderDescription },
CustomerOrder = new StringValue { Value = order.order_number.ToString() },
ExternalReference = new StringValue { Value = externalReference },
Details = orderDetails.ToArray<SalesOrderDetail>(),
ShippingAddressOverride = new BooleanValue { Value = true },
ShippingContactOverride = new BooleanValue { Value = true },
ShippingContact = new Contact()
{
DisplayName = new StringValue { Value = order.shipping_address.company },
FirstName = new StringValue { Value = order.shipping_address.first_name },
LastName = new StringValue { Value = order.shipping_address.last_name },
Email = new StringValue { Value = order.customer.email },
Phone1 = new StringValue {
Value = (order.billing_address.phone.Length > 0) ? order.billing_address.phone : "-"
},
Address = new Address()
{
AddressLine1 = new StringValue { Value = order.shipping_address.address_1 },
AddressLine2 = new StringValue { Value = order.shipping_address.address_2 },
City = new StringValue { Value = order.shipping_address.city },
State = new StringValue { Value = order.shipping_address.state },
Country = new StringValue { Value = order.shipping_address.country },
PostalCode = new StringValue { Value = order.shipping_address.postcode }
},
CustomFields = new CustomField[]
{
new CustomStringField
{
Name = "Salutation",
Value = new StringValue { Value = order.shipping_address.first_name + " " + order.shipping_address.last_name },
}
}
},
ShipVia = new StringValue { Value = _shipViaOptions[order.shipping_methods] },
CustomFields = new CustomField[]
{
new CustomStringField
{
Name = "ShipTermsID",
Value = new StringValue { Value = _shipTermsOptions[order.shipping_methods] }
}
}
};
为什么这适用于 ShippingTermsID 而不适用于 Salutation?
在 post 你 link 看到这部作品的地方,。
有人提到,当您使用的是 5.30 版时,这种处理方式适用于 Acumatica 6.00 版及更高版本。
虽然幸运站在您这一边,但您尝试更新的字段在默认端点中,尽管它的名称不同。它的名字是 "Position".
我正在通过 ASP.net 进行 Acumatica 集成,通过基于 API 的合同在 Acumatica 中创建销售订单。我正在使用 5.30 版。有些字段是 Acumatica 对象的标准字段,有些则不是。对于那些不存在的,我看到了一种使用 CustomFields 属性 的方法
我尝试通过 CustomFields 属性 更新此字段,但它不起作用:
orderToBeCreated = new SalesOrder
{
OrderType = new StringValue { Value = "SO" },
CustomerID = new StringValue { Value = customerID },
Description = new StringValue { Value = orderDescription },
CustomerOrder = new StringValue { Value = order.order_number.ToString() },
ExternalReference = new StringValue { Value = externalReference },
Details = orderDetails.ToArray<SalesOrderDetail>(),
ShippingAddressOverride = new BooleanValue { Value = true },
ShippingContactOverride = new BooleanValue { Value = true },
ShippingContact = new Contact()
{
DisplayName = new StringValue { Value = order.shipping_address.company },
FirstName = new StringValue { Value = order.shipping_address.first_name },
LastName = new StringValue { Value = order.shipping_address.last_name },
Email = new StringValue { Value = order.customer.email },
Phone1 = new StringValue {
Value = (order.billing_address.phone.Length > 0) ? order.billing_address.phone : "-"
},
Address = new Address()
{
AddressLine1 = new StringValue { Value = order.shipping_address.address_1 },
AddressLine2 = new StringValue { Value = order.shipping_address.address_2 },
City = new StringValue { Value = order.shipping_address.city },
State = new StringValue { Value = order.shipping_address.state },
Country = new StringValue { Value = order.shipping_address.country },
PostalCode = new StringValue { Value = order.shipping_address.postcode }
},
CustomFields = new CustomField[]
{
new CustomStringField
{
Name = "Salutation",
Value = new StringValue { Value = order.shipping_address.first_name + " " + order.shipping_address.last_name },
}
}
},
ShipVia = new StringValue { Value = _shipViaOptions[order.shipping_methods] },
CustomFields = new CustomField[]
{
new CustomStringField
{
Name = "ShipTermsID",
Value = new StringValue { Value = _shipTermsOptions[order.shipping_methods] }
}
}
};
为什么这适用于 ShippingTermsID 而不适用于 Salutation?
在 post 你 link 看到这部作品的地方,
虽然幸运站在您这一边,但您尝试更新的字段在默认端点中,尽管它的名称不同。它的名字是 "Position".