Pages

Tuesday, November 15, 2016

Document Attachment through X++

static void hb_attach(Args _args)

{

DocuRef docuRef;

DocuActionArchive archive;

CustTable _custtable;

str _name;

;

 

_name=@"c:\\hb.docx";

select RecId from _custtable where _custtable.AccountNum =="M0001";

 

if (_custtable!=null)

{

ttsBegin;

docuRef.clear();

docuRef.RefRecId = _custtable.RecId;

docuRef.RefTableId = tableNum("custtable");

docuRef.RefCompanyId = curext();

docuRef.Name = _name;

docuRef.TypeId = 'File';

docuRef.insert();

archive = new DocuActionArchive();

archive.add(docuRef, _name);

ttsCommit;

}

}

0 yorum:

Post a Comment