如何使用 Acumatica ReturnBehavior 指定详细记录的字段
How to specify fields for detail records with Acumatica ReturnBehavior
我正在尝试使用 Acumatica API 来 return 销售订单和销售订单详细信息列表,同时限制字段 returned。
到目前为止,我有:
SalesOrder filter = new SalesOrder
{
//Filter the SOs returned
OrderType = new AcumaticaOpticsExt.StringValue { Value = salesOrder.Split('/').First() },
OrderNbr = new AcumaticaOpticsExt.StringValue { Value = salesOrder.Split('/').Last() },
//Specify return behavior
ReturnBehavior = ReturnBehavior.OnlySpecified,
//Specify the fields to be returned on the SO
Hold = new BooleanReturn(),
CustomerName = new StringReturn(),
SchedShipment = new DateTimeReturn(),
QtyAllocatedM = new DecimalReturn(),
QtyAllocatedNotCompletedM = new DecimalReturn(),
//And from the SO Line Detail
};
我不清楚如何从详细信息中指定字段,并且我在文档中没有发现任何多级用途。
有人举个例子吗?
这是一个对我有用的例子:
SalesOrder so = new SalesOrder
{
ReturnBehavior = ReturnBehavior.OnlySpecified,
OrderType = new StringSearch { Value = "SO", Condition = StringCondition.Equal },
OrderNbr = new StringSearch { Value = "001253", Condition = StringCondition.Equal },
Details = new SalesOrderDetail[]
{
new SalesOrderDetail
{
ReturnBehavior = ReturnBehavior.OnlySpecified,
InventoryID = new StringReturn(),
LineNbr = new IntReturn(),
UOM = new StringReturn(),
UnitPrice = new DecimalReturn(),
Quantity = new DecimalReturn()
}
}
};
您只需定义详细信息项的数组,在第一个中定义您想要的 return 行为级别,如果它应用了您想要的字段 returned.
我正在尝试使用 Acumatica API 来 return 销售订单和销售订单详细信息列表,同时限制字段 returned。
到目前为止,我有:
SalesOrder filter = new SalesOrder
{
//Filter the SOs returned
OrderType = new AcumaticaOpticsExt.StringValue { Value = salesOrder.Split('/').First() },
OrderNbr = new AcumaticaOpticsExt.StringValue { Value = salesOrder.Split('/').Last() },
//Specify return behavior
ReturnBehavior = ReturnBehavior.OnlySpecified,
//Specify the fields to be returned on the SO
Hold = new BooleanReturn(),
CustomerName = new StringReturn(),
SchedShipment = new DateTimeReturn(),
QtyAllocatedM = new DecimalReturn(),
QtyAllocatedNotCompletedM = new DecimalReturn(),
//And from the SO Line Detail
};
我不清楚如何从详细信息中指定字段,并且我在文档中没有发现任何多级用途。
有人举个例子吗?
这是一个对我有用的例子:
SalesOrder so = new SalesOrder
{
ReturnBehavior = ReturnBehavior.OnlySpecified,
OrderType = new StringSearch { Value = "SO", Condition = StringCondition.Equal },
OrderNbr = new StringSearch { Value = "001253", Condition = StringCondition.Equal },
Details = new SalesOrderDetail[]
{
new SalesOrderDetail
{
ReturnBehavior = ReturnBehavior.OnlySpecified,
InventoryID = new StringReturn(),
LineNbr = new IntReturn(),
UOM = new StringReturn(),
UnitPrice = new DecimalReturn(),
Quantity = new DecimalReturn()
}
}
};
您只需定义详细信息项的数组,在第一个中定义您想要的 return 行为级别,如果它应用了您想要的字段 returned.