gpayne
(Greg Payne)
February 13, 2023, 5:30pm
19
@Ernie It is part of our tariff processing, so I can’t share the dashboard it is in, but I will try to strip out just the attachment parts and post them when I get a chance.
I based it on a couple of posts from @josecgomez and @jgiese.wci so the code is here.
This is the code I use for quickly attaching something from BPM land. I used a Func becuse I was doing multiple attachments, but maybe someday we’ll have global functions we can just call on like our own widgets… achem @Bart_Elia hint hint
Mine pulls from a UNC directory for it’s reference, but if you want to write standard Csharp to move the file or instead use the BOs and the attachment type for that you can do that as well.
Func<string, Guid, string, string, int> AttachFile = (iFilename, iR…
This is an example using DocStar but the BO’s are the same just use UploadFile instead of DocStarUploadFile
//Read file from Disk into a byte array
Byte[] bytes = File.ReadAllBytes(x);
String fileData = Convert.ToBase64String(bytes);
//Create the File Object to be uploaded to Epicor
var file = new
{
fileName = System.IO.Path.GetFileName(x),
data = fileData,
…
1 Like