我想将生成的文本文件保存在Acumatica页面的“file”部分,方法是单击“保存文件”。这是我当前生成文本文件的代码:
string[] lines = { fileLine1, fileLine2, fileLine3 };
File.WriteAllLines(path, lines);这只是在我的机器上指定的路径中生成一个文本文件。
批量支付屏幕的屏幕截图
任何帮助都将不胜感激。
发布于 2021-03-18 15:30:04
我会尝试下面这样的东西,其中'message‘是一个字符串。
using (MemoryStream stream = new MemoryStream())
{
stream.Write(Encoding.UTF8.GetBytes(message), 0, message.Length);
string path = "MyFile.txt";
PX.SM.FileInfo info = new PX.SM.FileInfo(path, null, stream.ToArray());
//Attach file to Doc
info.Comment = "message generated on " + DateTime.Now.ToShortDateString();
UploadFileMaintenance upload = PXGraph.CreateInstance<UploadFileMaintenance>();
//Save file to acumatica
if (upload.SaveFile(info, FileExistsAction.CreateVersion))
{
//Create connection to the Batch
PXNoteAttribute.SetFileNotes(mysetup.connection.Cache, conn, info.UID.Value);
}
}https://stackoverflow.com/questions/66690633
复制相似问题