Skip to main content
Solved

GI to default to show values in UserPreferences.DefBranchID


AWelty24
Jr Varsity II
Forum|alt.badge.img

Is it possible to make a GI (or ideally, a dashboard tile based on that GI)  sensitive to the value in UserPreferences.DefBranchID?

(I reckon that if there is no value in UserPreferences.DefBranchID, this requirement, ideally, would be ignored)

I have tried to edit the filter on the dashboard gadget but the 'Value1' field doesn't allow me to pass through a dynamic field such as UserPreferences.DefBranchID - it only allows me to hard-code a certain value.

Perhaps there is another way to go about this.

Or perhaps this related Community Idea is as far as we can get. 

It would just be handy if we could retrieve the value for the User’s default branch and show them the data for that branch.

 

 

Best answer by AWelty24

Hi @lauraj46 - thanks for chiming in.

So I had been wondering if I could/should join in that UserPreferences DAC- thanks for nudging me along on that. I added it and joined on the BranchID, thinking I’d need a left join in case the user’s default branch id wasn’t set (UserPreferences.DefBranchID NULL) . But even with an INNER join I was still seeing all the data. I wonder if it’s because I am not able to clearly enough indicate to the Inquiry that I want the Current, logged-in User’s value for UserPreferences.DefBranchID . It seems to me like maybe it’s linking on any instance fo the User Preference being set to that branch.

 

However the link you sent was helpful as I think it can get me there. Instead of using the customization project in the comments, I tried the main post’s technique of creating a ‘CurrentBranch’ parameter and calling that in my filter. That seems to be working ok. I’m torn on this as a long-term solution because ideally, I’m just setting a default for the first time the user looks at the inquiry. Ideally I wouldn’t be necessarily LIMITING everything the user can see by only ever showing the current logged-in branch. However  - I think this is ok for now.

Thanks for all the helpful ideas you share on the Community and it’s great to hear from my friend! :) 

 

Also - thanks for upvoting the idea @DConcannon  !

View original
Did this topic help you find an answer to your question?

5 replies

lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • 505 replies
  • October 13, 2022

Hi Arlene @AWelty24 !

If you don’t need a dynamic parameter and just want the results to default based on the user’s default branch, I would add the UserPreferences DAC to the list of tables in your GI and join it by the BranchID to your transactional data.

We had a slightly different requirement recently, to filter dynamically based on the Branch selected in the company/branch selector.  We used the customization technique referenced towards the end of the comments on the thread below, and so far it seems to be working great.  The customization adds a new DAC which makes the “current” branch available for use in a GI.

https://asiablog.acumatica.com/2018/11/generic-inquiry-with-filtering-by-current-branch.html

Laura

 


DConcannon
Varsity II
Forum|alt.badge.img+2
  • Varsity II
  • 119 replies
  • October 13, 2022

@AWelty24

Or perhaps this related Community Idea is as far as we can get. 

For what it’s worth, I voted on the 3 year old idea, obviously there is a need for it as @lauraj46 reply indicates.

The challenge with ideas is there is no way to subscribe to new ones or receive updates to ones you have up-voted. The good news is Acumatica is actively working on getting a subscription feature available.


AWelty24
Jr Varsity II
Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • 17 replies
  • Answer
  • October 14, 2022

Hi @lauraj46 - thanks for chiming in.

So I had been wondering if I could/should join in that UserPreferences DAC- thanks for nudging me along on that. I added it and joined on the BranchID, thinking I’d need a left join in case the user’s default branch id wasn’t set (UserPreferences.DefBranchID NULL) . But even with an INNER join I was still seeing all the data. I wonder if it’s because I am not able to clearly enough indicate to the Inquiry that I want the Current, logged-in User’s value for UserPreferences.DefBranchID . It seems to me like maybe it’s linking on any instance fo the User Preference being set to that branch.

 

However the link you sent was helpful as I think it can get me there. Instead of using the customization project in the comments, I tried the main post’s technique of creating a ‘CurrentBranch’ parameter and calling that in my filter. That seems to be working ok. I’m torn on this as a long-term solution because ideally, I’m just setting a default for the first time the user looks at the inquiry. Ideally I wouldn’t be necessarily LIMITING everything the user can see by only ever showing the current logged-in branch. However  - I think this is ok for now.

Thanks for all the helpful ideas you share on the Community and it’s great to hear from my friend! :) 

 

Also - thanks for upvoting the idea @DConcannon  !


lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • 505 replies
  • October 14, 2022

Hi @AWelty24 ,

Nice to hear from you, and glad that you got this working!

Good point about the UserPreferences including all users.  It sounds like you already have a working solution, but if you ever have reason to fix the join you should be able to add a condition to filter it on the current user.  You can use the @me option to dynamically default a parameter with the current user, and then add that parameter to the Conditions.

I also upvoted the idea.  This requirement comes up a lot and it would be great if there was a standard parameter that worked like @me.

Laura


AWelty24
Jr Varsity II
Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • 17 replies
  • October 19, 2022

@lauraj46 Thank you for reminding me about the @me option!
Brilliant as always. :)
Arline


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings