如何使用 Contract Web 服务从 Bills and Adjustments 附件中检索文件

How can I retrieve a file from a Bills and Adjustments attachment using Contract Web services

我已经使用 Acumatica 提供的基于合同的 Web 服务示例成功地从库存项目屏幕检索了一个文件。我的问题是关于账单和调整屏幕的语法来做同样的事情。有问题的代码在这里:

对于库存项目,语法是:

string stockItem = rs.GetByKeys("StockItem", inventoryID, "$expand=files");

GetByKeys 调用是:

public string GetByKeys(string entityName, string keys, string parameters)
{
    var res = _httpClient.GetAsync(
    _acumaticaBaseUrl + "/entity/Default/20.200.001/" + entityName + "/" + keys + "?" + parameters).Result.EnsureSuccessStatusCode();

    return res.Content.ReadAsStringAsync().Result;
}

其中实体名称是“StockItem”,键值为库存 ID。

所以,我的问题是,要使用 Bills and Adjustments 屏幕,keys 的值是什么(可能是 RefNbr?)以及 entityName 是什么(可能是“Bills”?- 它指的是端点屏幕?)?

谢谢...

端点实体是 Bill

您可以使用 SQL 来识别目标 ScreenID 的端点实体:

select ObjectName from EntityDescription where ScreenID = 'AP301000'

键值与 DAC/Table 中使用的键值相同。

在这种情况下,它是 APInvoice.DocType 和 APInvoice.RefNbr(CompanyID 是被忽略的系统密钥):

密钥需要在 URL 中以斜杠字符“/”分隔,并以相同的顺序提供。 'Bill 002789' 的示例是 'INV 002789',INV 是文档类型代码,002789 是 RefNbr:

http://localhost/Acumatica/entity/Default/20.200.001/Bill/INV/002789?$expand=files