RE: Customizing the document upload dialog box for attachments in D365
I have written COC for DocumentManagement, it is the base for data traversing and working fine.
[ExtensionOf(classStr(DocumentManagement))]
final class DocumentManagement_Extension
{
public static DocuRef attachFileToDocuRef(RecId _docuRefRecId, System.IO.Stream _file, str _fileName, str _fileContentType, str _attachmentName, str _notes)
{
DocuRef docuRef;
_fileName = CustomTable.field _fileName;
_attachmentName = CustomTable.field _attachmentName;
docuRef = next attachFileToDocuRef(_docuRefRecId,_file,_fileName,_fileContentType,_attachmentName,_notes);
return docuRef;
}
}
but closeOk is not working, even debugger did not came.I nee to fill value in table before DocumentManagement class calling.
[ExtensionOf(formStr(DocumentUpload))]
final class DocumentUpload_Extension
{
public void closeOk()
{
next closeOk();
Formrun thisForm = this;
Common targetRecord = thisForm.args().record();
if (targetRecord && targetRecord.TableId == tableNum(DocuRef))
{
DocuRef docuRef = targetRecord;
Info(strFmt("Close ok %1 %2",docuRef.RecId,docuRef.ValueRecId));
}
}
}