Skip to main content
Question

Get Vendor registered or configured Tax Id's

  • March 28, 2024
  • 1 reply
  • 52 views

Forum|alt.badge.img

Hi Team,

I need to get the Vendor registered or configured Tax Id's (Tax class) to a foreach loop for a particular vendor record (BAccountID  = X). Can someone please help me out to give me the BQL query for this?

Thanks

Bhagya  

1 reply

Leonardo Justiniano
Jr Varsity II
Forum|alt.badge.img+4

Hi @bhagyat25 

If you are asking about this:

Vendor Purchase Settings

 

The query is based on the Location class

Inspecting TaxRegistrationID

as follow:

...
using PX.Object.AP;
...

var q = new SelectFrom<VendorAttribute.Location>
.Where<Use<VendorAttribute.Location.bAccountID>.AsInt.IsEqual<@P.AsInt>>
.View(graph);

foreach(Vendor v in VendorList)
{
...
if(v.BAccountID == targetBAccountID)
{
...

VendorAttribute.Location loc = q.Select(targetBAccountID).FirstOrDefault();

string taxRegID = loc.TaxRegistrationID;
...
}
...
}
...