Tuesday, 7 May 2019

Upload Doc using X++ for Record

static void UploadDocWorking(Args _args)

{

DocuRef docuRef;

DocuActionArchive archive;

SHP_LinkLogistics _custtable;

str _name;

;



_name=@"c:\SR_SalesInvoice.pdf";

select RecId from _custtable where _custtable.SHP_ConsignmentNumber =="PL-000013";



if (_custtable!=null)

{

ttsBegin;

docuRef.clear();

docuRef.RefRecId = _custtable.RecId;

docuRef.RefTableId = tableNum("SHP_LinkLogistics");

docuRef.RefCompanyId = curext();

docuRef.Name = _name;

docuRef.TypeId = 'File';

docuRef.insert();

archive = new DocuActionArchive();

archive.add(docuRef, _name);

ttsCommit;

}





}

No comments:

Post a Comment