After add EDT FileNameOpen to form using New -> stringEdit,
add some form methods:
str fileNameLookupFilename()
{
return '';
}
str fileNameLookupTitle()
{
return "@SYS53008";
}
str fileNameLookupInitialPath()
{
return '';
}
Result:
str fileNameLookupFilename()
{
return '';
}
str fileNameLookupTitle()
{
return "@SYS53008";
}
str fileNameLookupInitialPath()
{
return '';
}
container fileNameLookupFilter()
{
return ['All files','*.*'];
}
{
return ['All files','*.*'];
}
After get the file path, call insert method:
public void AvInsertAttachment(filename file, int i)
{
DocuRef docuRef;
DocuActionArchive archive;
;
if(file)
{
ttsbegin;
docuRef.clear();
docuRef.RefRecId = DirPartyEntity.RecId;
docuRef.RefTableId = tableNum(CustTable);
docuRef.RefCompanyId = DirPartyEntity.dataAreaId;
docuRef.Name = strFmt("Consultant Attachment %1", i);
docuRef.TypeId = 'File';
docuRef.insert();
archive = new DocuActionArchive();
archive.add(docuRef, file);
ttsCommit;
}
}
No comments:
Post a Comment