To find Customer Registration Id

 public  TaxRegistrationNumber getCustVATNo(CustTable _custTable ,str _type)

    {

 

        TaxRegistration                             taxRegistration;
        DirPartyLocation                            partyLocation;
        TaxRegistrationTypeApplicabilityRule        taxRegistrationRule;
        TaxRegistrationType                         taxRegistrationType;

 

        select *
           from taxRegistration
        join partyLocation
        join taxRegistrationRule
        join taxRegistrationType
            where taxRegistration.DirPartyLocation == partyLocation.RecId
            && partyLocation.Party == _custTable.Party
            && taxRegistration.TaxRegistrationTypeApplicabilityRule == taxRegistrationRule.RecId
            && taxRegistrationRule.TaxRegistrationType == taxRegistrationType.RecId
            && taxRegistrationType.TaxRegstrationType == _type;

 

        return taxRegistration.RegistrationNumber;

 

    }


Regards 
Muhammad Farraz

email: farazjaved01@gmail.com

Comments

Popular posts from this blog

How to Bypass Next in COC in D365 X++

create movement journal through code in d365 FO x++