Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Acumatica:如何使用Web API从SO屏幕获取附件文件?_Api_Acumatica - Fatal编程技术网

Acumatica:如何使用Web API从SO屏幕获取附件文件?

Acumatica:如何使用Web API从SO屏幕获取附件文件?,api,acumatica,Api,Acumatica,我将按照i200pdf中的一个库存商品的示例,但我不知道如何从销售订单下载该文件。有人有线索吗 IN202500Content stockItemSchema = context.IN202500GetSchema(); var commands = new Command[] { new Value { Value = "AAMACHINE1", LinkedCommand = stockItemSchema.StockItemSummary.Inventory

我将按照i200pdf中的一个库存商品的示例,但我不知道如何从销售订单下载该文件。有人有线索吗

IN202500Content stockItemSchema = context.IN202500GetSchema();
var commands = new Command[]
{
   new Value
   {
     Value = "AAMACHINE1",
     LinkedCommand = stockItemSchema.StockItemSummary.InventoryID
   },
   new Value
   {
     FieldName = "T2MCRO.jpg",
     LinkedCommand =
     stockItemSchema.StockItemSummary.ServiceCommands.Attachment
   }
};
var stockItemAttachment =
context.IN202500Export(commands, null, 1, false, true);

您就快到了,在“stockItemAttachment”变量中,您应该有字节格式的文件“T2MCRO.jpg”的内容

您唯一要做的就是将其写入文件系统。 可以使用以下命令:

File.writealBytes(路径,Convert.FromBase64String(stockItemAttachment[0][0])