如何在Acumatica API中检索StockItems中的属性字段? [英] How To Retrieve An Attribute Field In StockItems In Acumatica API?

查看:74
本文介绍了如何在Acumatica API中检索StockItems中的属性字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以在Web Service API中检索特定属性?
我在导出时尝试了 IN202500.AttributesAttributes.Value ,但是列出了清单的所有属性。我还注意到属性在清单表中以[AttributeName] _Attributes的形式保存在表中,是否有任何方法可以检索呢?

I am wondering if a specific attribute can be retrieved in the Web Service API? I have tried IN202500.AttributesAttributes.Value when exporting but that listed all attributes of the inventory. I also noticed the attributes are saved in the table as [AttributeName]_Attributes in the Inventory table, is there any way of retrieving this?

这是我正在使用的代码(期望它将检索属性)

This is the code I am using (expecting it would retrieve the Attributes)

IN202500Content IN202500 = context.IN202500GetSchema();
context.IN202500Clear();

Command[] oCmd = new Command[] {
                      IN202500.StockItemSummary.ServiceCommands.EveryInventoryID,
                      IN202500.StockItemSummary.InventoryID,
                      IN202500.StockItemSummary.Description, 
                      IN202500.StockItemSummary.ItemStatus, 
                      IN202500.GeneralSettingsItemDefaults.ItemClass, 
                      IN202500.GeneralSettingsItemDefaults.LotSerialClass,
                      new Field  {  
                          ObjectName = IN202500.StockItemSummary.InventoryID.ObjectName,
                          FieldName = "BARCODE_Attributes"}, 
                      new Field  {  
                          ObjectName = IN202500.StockItemSummary.InventoryID.ObjectName, 
                          FieldName = "DfltReceiptLocationID"},   
                      new Field  {  
                          ObjectName = IN202500.StockItemSummary.InventoryID.ObjectName, 
                          FieldName = "LastModifiedDateTime"}   
                      };

Filter[] oFilter = new Filter[] {
                      new Filter 
                      {
                          Field = new Field {
                              ObjectName = IN202500.StockItemSummary.InventoryID.ObjectName,
                              FieldName = "LastModifiedDateTime"},
                          Condition = FilterCondition.Greater,
                          Value = SyncDate
                       }
                    };

String[][] sReturn = context.IN202500Export(oCmd, oFilter, 0, true, false);

但是属性字段返回的是一个空字符串。
谢谢,
G

But the Attribute field returned is an empty string. Thanks, G

推荐答案

您可以利用添加到主视图中的动态字段屏幕上检索特定的属性值。这些字段未显示在WSDL模式中,因此您必须创建一个Field对象并将其传递给Export函数。

You can leverage the dynamic fields that are added to the primary view of the screen to retrieve specific attribute values. These fields don't show up in the WSDL schema, so you have to create a Field object and pass it to the Export function.

我通过显示本机对象/本机字段名称列从导出方案中查找了字段名称和对象名称。产生的导出调用如下所示:

I looked up the field name and object name from an Export scenario by displaying the Native Object / Native Field name columns. Resulting Export call looks like this:

        var result = screen.Export(new IN202500.Command[] { 
            new IN202500.Value() { LinkedCommand = schema.StockItemSummary.InventoryID, Value = "Z730P00073"},
            schema.StockItemSummary.InventoryID,
            schema.StockItemSummary.Description,
            new IN202500.Field { FieldName = "COLOR_Attributes", ObjectName = "Item"},
            new IN202500.Field { FieldName = "HWMAN_Attributes", ObjectName = "Item"},
        }, null, 0, true, true);

此代码将检索特定库存物料(Z730P00073)的两个属性值(COLOR和HWMAN属性) )。结果变量包含一个二维数组,请告知是否需要从数组中获取结果的帮助。

This code will retrieve the two attributes value (COLOR and HWMAN Attributes) for a specific inventory item (Z730P00073). The result variable contains a two-dimensional array, let me know if you need help getting results from the array.

这篇关于如何在Acumatica API中检索StockItems中的属性字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆