如何使用 Web 服务从屏幕 IN401000 获取数据

How can i get Data from Screen IN401000 using Webservices

大家好,我遇到了这个问题,我尝试从 table 中获取信息(例如一个 inventoryID 和所有子文章),但是咨询崩溃了,因为这需要很多时间。

我现在卡住了,我在 php 中有这个但是如果有人可以帮助我,如果是 C#

$Gate = new AcumaticaGate($user, $pass);
$schema = $Gate->Client->IN401000GetSchema(new IN401000GetSchema())->GetSchemaResult;
$Gate->Client->IN401000Clear(new IN401000Clear());

$export = new IN401000Export();
$export->commands = array
(
$schema->Selection->ServiceCommands->EveryInventoryID,
$schema->Selection->InventoryID,
//$schema->InventorySummary->DisplayName ,
//$schema->InventorySummary->InventoryID ,
//$schema->InventorySummary->Subitem ,
//$schema->InventorySummary->Warehouse ,
//$schema->InventorySummary->Available ,
//$schema->InventorySummary->BaseUnit,
);
$field = new Field();
$field->FieldName = "InventoryID";
$field->ObjectName = $schema->Selection->InventoryID->ObjectName;

$export->filters = array();

$filter_command = $Gate->PrepareSimpleFilter($field, FilterCondition::Contain, "10091"); // Filtro para buscar los 15 articulos Anteriores
array_push($export->filters,$filter_command);

$export->breakOnError = true;
$export->includeHeaders = false;
$export->topCount = 10;

try
{
    $export_result = $Gate->Client->IN401000Export($export)->ExportResult;
    unset($Gate->Client);
}
catch (Exception $e) {
    console($e);
}

return $export_result->ArrayOfString;

使用查询屏幕时,您始终必须使用 Submit 提交而不是 Export。下面是 C# 中的示例,显示了如何通过基于屏幕的 API 从给定库存项目的库存摘要 (IN401000) 屏幕导出数据:

IN401000WebRef.Content itemSumSchema = IN401000context.GetSchema();
var itemSumCommands = new IN401000WebRef.Command[]
{
    new IN401000WebRef.Value
    {
        LinkedCommand = itemSumSchema.Selection.InventoryID,
        Value = item[0]
    },
    new IN401000WebRef.Value
    {
        LinkedCommand = itemSumSchema.Selection.ExpandByLotSerialNumber,
        Value = "True"
    },
    itemSumSchema.InventorySummary.Warehouse,
    itemSumSchema.InventorySummary.Location,
    itemSumSchema.InventorySummary.OnHand,
    itemSumSchema.InventorySummary.EstimatedTotalCost,
    itemSumSchema.InventorySummary.LotSerialNumber
};
var serials = IN401000context.Submit(itemSumCommands);