AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • Rolodex
    • Podcast
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Acumatica Generic I...
Filter by Current U...
 
Notifications
Clear all

Questions Filter by Current UserID

 
Acumatica Generic Inquiries & Pivot Tables
Last Post by gprice 5 years ago
9 Posts
4 Users
1 Reactions
10.8 K Views
RSS
DWS253
Posts: 33
 DWS253
Topic starter
September 8, 2017 12:39 pm
(@dws253)
Member
Joined: 8 years ago

Does anyone know how to build a GI Condition so that the user logged in would only be able to see records that have his/her ID in the record?  Example would be list only the customers where I am listed on the Salespersons tab of the Customer maintenance screen.  I know I can build Row Level security to get to this level of control, but there are a lot of things I want to use this for and I think filtering GIs might provide the control I need.

Also, I think maintaining Row Level security is a HUGE pain and don't want to build more there than I have to.  Filtering GIs would be dynamic and be maintenance free.


8 Replies
John Doe Updated
Posts: 3193
 John Doe Updated
Admin
September 8, 2017 9:10 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Hi DWS253,

Try using @me, something like this:


Reply
DWS253
Posts: 33
 DWS253
Topic starter
September 12, 2017 3:33 pm
(@dws253)
Member
Joined: 8 years ago

I couldn't get that to work.  I keep getting errors referring to Unique Identifiers not converting to int or whatever.  

I did find this, https://stackoverflow.com/search?page=4&tab=Relevance&q=%5bacumatica%5d%20%40me, which I thought was a really good lead and info everyone who works with GIs should have access to (Company, Branch, Businsess Date, UserID, etc.), but I couldn't get it to work either.  The error I get is "Invalid object name 'Accessinfo'."  

I thought maybe it was the way I was linking in the AccessInfo, so I created a GI with AccessInfo as the only table, added all columns to the Results Grid.  When I run it, all the column headings show up in the grid, but I get no data and still get the "Invalid object name 'Accessinfo'" error .

Any ideas?


Reply
DWS253
Posts: 33
 DWS253
Topic starter
September 12, 2017 5:59 pm
(@dws253)
Member
Joined: 8 years ago

Sorry.  Didn't test the link after I copied it from my browser.  Ones you go to the StackOverflow link, https://stackoverflow.com/search?page=4&tab=Relevance&q=%5bacumatica%5d%20%40me, /p>

search for "Determining Current User for Generic Inquiry".


Reply
John Doe Updated
Posts: 3193
 John Doe Updated
Admin
September 12, 2017 9:58 pm
(@timrodman)
Famed Member
Joined: 10 years ago

There are a number of DACs out there that get populated at run-time by some code in a screen so they are empty in a Generic Inquiry or Report Designer. I'm not positive about AccessInfo, but that might be one of them.

I cheated in my example above by using POOrder.LastModifiedByID 🙂

I'm not really sure how to do it with Salespeople.


Reply
Shawn P Slavin
Posts: 196
 Shawn P Slavin
January 12, 2018 5:24 pm
(@shawn-p-slavin)
Estimable Member
Joined: 6 years ago

DW5253, did you find an answer? 

I just wanted to point out that even though you can easily mentally make the connection between you the user (user id) and you the salesperson (salesperson ID), Acumatica needs help doing that.  The trick here is to add the user table, the employee table, and the salesperson table in your GI. You then link the user table to the employee table and then link the employee table to the salesperson table. (Hopefully, you set up employees and have your employee record linked to your user account.)  

From the employee record, you can then follow the next link to the related salesperson id.  (Again, hopefully, you are relating your employees to their corresponding salesperson)

With this chain, you can use @Me to get your user id, link it to your employee, and then to your salesperson id.

By using equal joins for the two table relationships,  when you filter with @me on the user ID, you should only see rows where you are the salesperson.

Sounds feasible in theory. I look forward to giving this a whirl this weekend.


Reply
John Doe Updated
Posts: 3193
 John Doe Updated
Admin
January 12, 2018 5:29 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Sounds like you're in for a fun weekend Shawn 🙂


Reply
John Doe Updated
Posts: 3193
 John Doe Updated
Admin
December 26, 2018 8:27 pm
(@timrodman)
Famed Member
Joined: 10 years ago

FYI, I just did something with @me using the Reports to field on the Employees (EP203000) screen which corresponds to the EPEmployee.SupervisorID DAC field.

 

I added the EPEmployee DAC twice to the TABLES tab on the Generic Inquiry (SM208000) screen:

 

Then I joined Employee to Supervisor on Employee.SupervisorID=Supervisor.BAccountID.

Which allowed me to do the following on the CONDITIONS tab on the Generic Inquiry (SM208000) screen (note the Or):

 

You have to use the UserID field because @me returns a UserID.

The end result was a Generic Inquiry which shows Time Cards for both the Current User and anyone who reports to the Current User.


Reply
gprice
Posts: 1
 gprice
November 23, 2020 7:12 pm
(@gprice)
New Member
Joined: 5 years ago

The easiest solution I have found is to add a hidden Parameter to your GI. Reference the parameter to the ID field that you to filter off (eg for EPApprovals it would be OwnerID)  Make the default of the hidden parameter @me

image

Then just condition your GI to use that Parameter

image

Reply
John Doe Updated reacted
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,526 Topics
  • 10.9 K Posts
  • 52 Online
  • 2,410 Members
Our newest member: thollings
Latest Post: Attribute Input Mask
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

 No online members at the moment

Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2025 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×