Questions [Solved] Selected Branch Name on Report
Hi, I'm attempting to print the branch name on the report that I'm running. I can get the name of the branch to print that is selected at the top of the screen, but not the branch name selected in the report. In the header of the image below, the Branch ID currently prints on the "Branch" section, whereas I would like the branch name to print where the "Company" field is.
For reference, I'm working from one of the out-of-the-box Acumatica reports, Journal Transactions for Period. The formula that looks promising to me is =Report.GetDefUI('CompanyBAccount.AcctName'), which is what @BranchID is defined by in the report schema. This is not the default formula, FYI.
I would like to modify this formula to print the branch name instead of the branch ID.
Here is the current report, where I have "Subsidiary" selected on top (prints in the Company field), but "HQ" selected when I run the report:
I solved this problem in ARM using "=Report.GetBranchText(@StartBranch)", however Report Designer has a different set of definitions and I don't know how to access the ARM schema that defines "@StartBranch". This may be a path to the answer. Any suggestions are appreciated.
Does this formula work for you?
Note that in Acumatica 2018 R1 there are both Companies AND Branches, not just Branches. So you might need to change the formula to the following in Acumatica 2018 R1:
Unfortunately the applicable one didn't work, it just shows a blank field when I use it -- =Report.GetDescription('OrganizationBranchReportParameters.BranchID',[@BranchID])
I'll post if I find a good solution to this.
Can you attach your .rpx file to this post?
I was able to come up with a solution to this. The variable I needed is "Branch.AcctName," but the trick was using it to define a variable below the header. See screenshot below. I defined the $CoName variable in the lower part of the report where the branch was already clear. When I attempted to do this in the report header it didn't work. I guess the branch defaults to what's selected on the top of the screen until a different branch is defined.
Here's the .RPX file:
I think this is pretty clear, but let me know if it's not. Thanks for looking at this!
Interesting that the formula didn't work. But your variable method totally works. Nice job!
FYI - in 2020R1 the following formula worked on AP report (Payment Register). The IsNull is used to get either the branch or company name/description:
If anyone has a similar approach formula to get the [Branch.BranchOrOrganizationLogoNameReport] based on a parameter it would be very helpful as well.