How to add a document handling note in Microsoft Dynamics 365 for Finance and Operations through X++
How to add a document handling note in
Microsoft Dynamics 365 for Finance and Operations through X++
custTable custTable;
DocuType docuType;
DocuRef docuRef;
custTable = custTable::find('US-001');
docuType = DocuType::find('Note');
if (!docuType || docuType.TypeGroup != DocuTypeGroup::Note)
{
throw error("Invalid type");
}
docuRef.RefCompanyId = custTable.dataAreaId;
docuRef.RefTableId = custTable.TableId;
docuRef.RefRecId = custTable.RecId;
docuRef.TypeId = docuType.TypeId;
docuRef.Name = 'Add note';
docuRef.Notes = 'Add note using x++';
docuRef.insert();
Comments
Post a Comment