Skip to main content

Posts

Showing posts from March, 2018

How to get Customer,Vendor VAT Registration Number by code in Axapta

To get Customer,Vendor VAT Registration Number by code in Axapta in 2012 version you can try below code in data method on table label then you can use the method in string control on form . This code will work perfectly . display name Get_TaxRegistration() { TransDate _transDate = systemDateGet(); DirPartyLocation dirPartyLocation; TaxRegistration taxRegistration; TaxRegistrationTypeApplicabilityRule taxRegistrationTypeApplicabilityRule; if (_transDate) { dirPartyLocation = DirPartyLocation::findByPartyLocation( this.Party, this.invoiceAddress().Location); if (dirPartyLocation) { select firstonly validTimeState(_transDate) taxRegistration where taxRegistration.DirPartyLocation == dirPartyLocation.RecId join RecId from taxRegistrationTypeApplicabilityRule order by taxRegistrationTypeApplicabilityRule.IsPrimaryAddressRestricted desc

Code to Confirm and Post Project Item Requirement for Sales Order in Ax 2012

This is a sample Code to confirm and Post Project Item Requirement for Sales Order in Ax 2012 . You need to pass sales order in salesFormLetter class method update and you can pass transaction date or posting date as per your need it will create or post project sales order item requirement packing slip. Its same functionality as post button on project item requirement form. SalesFormLetter salesFormLetter; salesTable Salestablelocal; str 200 msg; salesid salesid; if(salesid) { select Salestablelocal where Salestablelocal.Salesid ==salesid && Salestablelocal.salestype==SalesType::ItemReq && Salestablelocal.SalesStatus==SalesStatus::Backorder; if(Salestablelocal) { ttsBegin; salesFormLetter = SalesFormLetter::construct(DocumentStatus::Confirmation); salesFormLetter.update(Salestablelocal); salesFormLetter = SalesFormLetter::constru