DocuRef docuRef = DocumentManagement::attachFile(
DTProrpertyHeader.TableId,
DTProrpertyHeader.RecId,
...
final class DTPropertyfileUpload
{
public static void main(Args _args)
{
FileUploadTemporaryStorageResult result;
DTProrpertyHeader dtProrpertyHeader;
dtProrpertyHeader = _args.record();
result = File::GetFileFromUser(classStr(FileUploadTemporaryStorageStrategy));
if(result.getUploadStatus())
{
str fileName = "YourFileName.jpeg"; //Insert the name of the attachchment
using(System.IO.MemoryStream stream = result.openResult() as System.IO.MemoryStream)
{
DocuRef docuRef = DocumentManagement::attachFile(
dtProrpertyHeader.TableId,
dtProrpertyHeader.RecId,
dtProrpertyHeader.DataAreaId,
DocuType::typeImage(),
stream,
fileName,
null,
fileName);
}
}
}
}
if (!_refTableId || !_refRecId || !_refDataAreaId || !_type || !_attachmentName || _file == null || !_fileName)
{
throw error(error::missingParameter(null));
}
final class DTPropertyfileUpload
{
public static void main(Args _args)
{
FileUploadTemporaryStorageResult result;
DTProrpertyHeader dtProrpertyHeader;
result = File::GetFileFromUser(classStr(FileUploadTemporaryStorageStrategy));
if(result.getUploadStatus())
{
str fileName = "YourFileName.jpeg"; //Insert the name of the attachchment
using(System.IO.MemoryStream stream = result.openResult() as System.IO.MemoryStream)
{
DocuRef docuRef = DocumentManagement::attachFile(
DTProrpertyHeader.TableId,
DTProrpertyHeader.RecId,
DTProrpertyHeader.DataAreaId,
DocuType::typeImage(),
stream,
fileName,
null,
fileName);
}
}
}
}
André Arnaud de Cal... 291,391 Super User 2024 Season 2
Martin Dráb 230,445 Most Valuable Professional
nmaenpaa 101,156