Generic Inquiry with Filtering by Current Branch

Hi All,

Want to show you an option how can you filter documents in Generic Inquiry by currently selected branch.

In reports you have an option to use AccessInfo.BranchID, but in generic inquiries unfortunately such option is not available. You also can’t join this table as AccessInfor is virtual table that does not exist in database.

However there is a workaround – we create a parameter in GI, that will get a default value from any branch field in Acumatica that has a default value from current branch and than use this filter for filtering.
Let me guide you:

  1. We need to create a parameter that will store a current Branch.
    1. This parameter should not be visible for user, so he can’t change it. To do this we can set Hidden flag to False. Hidden flag column is hidden by default so please check columns configuration.
    2. Default value can be taken from any of the the existing field where this default is used. Just for example – if you create a new Invoice (or order or payment, etc) the Branch field will be automatically populated by Acumatica. This is defaulting behavior that we can reuse in GI. SO if we set Schema Field to the field that has a default to current branch, the same value will appear in our GI. Please note that it is not necessary to join table in SQL to use it as a Schema Field. You can just mention it.
    3. It also makes sense to make this field as required to not provide any data if there is no current branch.

    Generic Inquiries Parameters

  2. Now we need to apply a filtering condition by this parameter:
    Generic Inquiries Conditions

That is it! Now you GI filters out all branches that is not current!
Hope it helps!

5 Replies to “Generic Inquiry with Filtering by Current Branch”

  1. Hello,

    I tried doing this method for Customer/Vendor GI in 2021R2 and have no luck with restricting the GI to filter the customer visibility restriction branch by the current branch the user is in. Any chance you have a solution for this? I tried it with the customization package for current branch dac but no luck there either.

    1. Hi Jennie, could you please check that your user has a default branch assigned.
      Also, you can make the field visible and see if the value is defaulted there.

  2. Thanks, Sergey! This is exactly what I’m looking for right now, but…

    Should this behavior work in 2018R2 (18.209.0021)? When I try this, it seems to pick up the current branch id as of when the GI is created rather than the run-time current branch id. The field I use for the current branch id has:
    in the DAC which appears to be working when creating the record.

    If I display the options in the parameter, I get only 1 option. Unfortunately, that option does not change as I change branches from the top of the screen. It stays as the branch that was current when I named the schema field in the GI. If I change branches, I have to go back to the GI and chance my schema field on the parameter to get it to pick up the new branch. Alternatively, it seems to work if I sign out, sign in, change branches, and THEN go to the GI.

    1. HI Brian,
      Unfortunately you are right. Parameters in GI are cached for redirection purpose. If you click Cancel, than parameters will be evaluated again, but of course it is not exact automatic.
      If you need this for branch changes, I think there might not be a good way except you customize or create own inquiry page.

Leave a Reply

Your email address will not be published. Required fields are marked *