【问题标题】:How can i get Data from Screen IN401000 using Webservices如何使用 Webservices 从屏幕 IN401000 获取数据
【发布时间】:2017-07-29 17:08:00
【问题描述】:

大家好,我遇到了这个问题,我尝试从这个表中获取信息(例如,一个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;

【问题讨论】:

    标签: c# php acumatica webservices-client


    【解决方案1】:

    使用查询屏幕时,您始终必须使用Submit commit 而不是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);
    

    【讨论】:

    • 谢谢,工作。但我有一个问题,只能一个库存一个?或者无论使用什么库存,都可以获得所有数据?多谢。贝尼
    • 由于 Inventory Summary 屏幕的原始设计,无法一次浏览或导出多个项目的数据。
    猜你喜欢
    • 2012-04-13
    • 1970-01-01
    • 1970-01-01
    • 2012-02-05
    • 1970-01-01
    • 2022-01-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多