Источник:
http://axaptacorner.blogspot.com/201...e-in-d365.html
==============
classVendAccountDocument_JKS
{
staticvoid main(Args _args)
{
VendTable vendTable;
DocuType docuType;
DocuRef docuRef;
vendTable = VendTable::find('BRMF-000001');
docuType = DocuType::find('Note');
if (!docuType ||
docuType.TypeGroup != DocuTypeGroup::Note)
{
throw error("Invalid document type");
}
docuRef.RefCompanyId = vendTable.dataAreaId;
docuRef.RefTableId = vendTable.TableId;
docuRef.RefRecId = vendTable.RecId;
docuRef.TypeId = docuType.TypeId;
docuRef.Name = 'Automatic note';
docuRef.Notes = 'Added from X++';
docuRef.insert();
info("Document note has been added successfully");
}
}
Источник:
http://axaptacorner.blogspot.com/201...e-in-d365.html