Skip to main content
Question

Filtering Branch Lookup by Current Organization in Acumatica

  • April 29, 2026
  • 1 reply
  • 16 views

Forum|alt.badge.img+2

I am trying to customize a Branch lookup in Acumatica so that it only shows branches belonging to the currently logged-in user's organization.

When a user opens the Branch selector, it should display only branches that belong to the same organization as the current branch.

The following SQL query returns the correct result:

SELECT *
FROM Branch
INNER JOIN Branch AS Br
ON Br.OrganizationID = Branch.OrganizationID
WHERE Br.BranchID = 22;

Here, 22 represents the current logged-in branch (AccessInfo.BranchID in Acumatica).

I tried to convert the same logic into BQL, but the result returns duplicate records instead of the expected filtered list.
 

 

Below are some of the approaches I tried: I also tried several other variations by making small changes, such as modifying the join type and other conditions, but I still ended up with the same result.
Following is the BranchAlies

public class BranchAlias : PX.Objects.GL.Branch { }

 

        [PXSelector(typeof(Search2<
Branch.branchID,
InnerJoin<BranchAlias,
On<BranchAlias.organizationID, Equal<Branch.organizationID>, And<BranchAlias.branchID, Equal<Current<AccessInfo.branchID>>>>>

>),
SubstituteKey = typeof(Branch.branchCD),
DescriptionField = typeof(Branch.acctName)
)]

[PXSelector(typeof(Search2<
Branch.branchID,
LeftJoin<
BranchAlias,
On<
BranchAlias.organizationID,
Equal<Branch.organizationID>
>
>,
Where
<BranchAlias.branchID,
Equal<Current<AccessInfo.branchID>>>

>),
SubstituteKey = typeof(Branch.branchCD),
DescriptionField = typeof(Branch.acctName)
)]


 

1 reply

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • April 29, 2026

@PDharmasena10  I have not verified, but can you please try below and check?

[PXSelector(
typeof(Search2<
Branch.branchID,
InnerJoin<Organization,
On<Branch.organizationID, Equal<Organization.organizationID>>>,
Where<
Branch.organizationID,
Equal<
Search<
Branch.organizationID,
Where<Branch.branchID, Equal<Current<AccessInfo.branchID>>>
>
>
>
>),
SubstituteKey = typeof(Branch.branchCD),
DescriptionField = typeof(Branch.acctName)
)]