Loading ...

Branch-Specific Preferences in Acumatica

To implement stable branch-specific preferences, you need four elements:

1.     BranchID as a key in the DAC

2.     Default value from AccessInfo.branchID

3.     View filtered by current branch

4.     PageLoadBehavior="SearchSavedKeys" in ASPX

If any of these elements is missing, unstable behavior may appear.

1. Preferences DAC (BranchID as Primary Key)

The preferences DAC must use BranchID as a primary key and automatically default it from the current branch context.

·        IsKey = true ensures one record per branch

·        PXDefault(typeof(AccessInfo.branchID)) assigns the current branch automatically

 

2.     Setup Graph (Filter by Current Branch)

The setup graph must always load preferences for the active branch.

Key points

·        The view is filtered by AccessInfo.branchID.FromCurrent

·        Users only work with their branch data

·        UI refresh is triggered after insert/update

3. Configure Page Load Behavior (Required)

<asp:Content ID="cont1" ContentPlaceHolderID="phDS" runat="Server">

    <px:PXDataSource ID="ds" runat="server" Visible="True" Width="100%" TypeName="Customization.Graph.BranchPreferencesMaint " PrimaryView="Preferences" PageLoadBehavior="SearchSavedKeys">

    </px:PXDataSource>

When using BranchID as a primary key, Acumatica does not always automatically load the record on page open.

To ensure the correct preferences record is selected, configure the ASPX page with SearchSavedKeys.

Why is this important?

SearchSavedKeys forces Acumatica to automatically search by primary key fields when the page loads.

Since BranchID is part of the key, the system automatically selects the correct record for the current branch.

Without this setting, the screen may open empty even when data exists.