Acumatica CustomFields不在销售订单上创建

时间:2017-03-13 16:59:10

标签: acumatica

我正在通过ASP.net进行Acumatica集成,通过基于合同的API在Acumatica中创建销售订单。我使用的是5.30版。有些字段是Acumatica对象的标准字段,有些则不是。对于那些不存在的,我使用CustomFields属性显示here方式,您可以在创建销售订单时向这些字段添加数据。这对SalesOrder对象很有用,但是,当我在Contact对象上尝试这个时,它不起作用。我正在尝试更新SalesOrder的送货设置选项卡上的“注意”字段。您可以在下图中看到此字段映射到“Salutation”数据字段。

enter image description here

我尝试通过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?

1 个答案:

答案 0 :(得分:4)

在帖子中,您链接了您看到此作品的位置here。 值得一提的是,当你使用的是版本5.30时,这种做事方式适用于Acumatica版本6.00及更高版本。

虽然Luck在您身边,但您尝试更新的字段位于默认端点,尽管名称不同。它的名字是“位置”。

enter image description here

相关问题