29 September 2018

Adding display method in AX7 or D365

///
/// This class contains display methods for TVItemPriceUpdateForm form controls
///

public static class TVItemPriceupdate_Extension
{
[SysClientCacheDataMethodAttribute(true)]
public static display DataAreaId companyId(TVItemPriceUpdate _this)
{
CompanyInfo company;
select DataArea,TVMemberId from company
where company.TVMemberId == _this.TVMemberId;

return company.DataArea;
}

}

28 September 2018

Data entities in D365 AX7 to delete staging records

Data entities in D365 AX7 to delete staging records

Please write new method as shown below to get records from staging and delete.

public static void postGetStagingData(DMFDefinitionGroupExecution _dmfDefinitionGroupExecution)
{
while select forupdate headerStaging
where headerStaging.ExecutionId == _dmfDefinitionGroupExecution.ExecutionId
&& headerStaging.DefinitionGroup == _dmfDefinitionGroupExecution.DefinitionGroup
{

}
}

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension->...