Get Company Tax Registration Number in d365 fo x++
//Get Company Tax Registration Number In dynamic 365 finance and operation
public TaxRegistrationNumber getTaxRegistrationByType(companyInfo _compInfo, str _type)
{
TaxRegistration taxRegistration;
DirPartyLocation partyLocation;
TaxRegistrationTypeApplicabilityRule taxRegistrationRule;
TaxRegistrationType taxRegistrationType;
select firstonly RegistrationNumber from taxRegistration join partyLocation join taxRegistrationRule join taxRegistrationType
where taxRegistration.DirPartyLocation == partyLocation.RecId
&& partyLocation.Party == _compInfo.RecId
&& taxRegistration.TaxRegistrationTypeApplicabilityRule == taxRegistrationRule.RecId
&& taxRegistrationRule.TaxRegistrationType == taxRegistrationType.RecId
&& taxRegistrationType.TaxRegstrationType == _type;
return taxRegistration.RegistrationNumber;
}
Comments
Post a Comment