Skip to main content
Solved

GI for Restriction Groups -Customer Access (AR102000)-


adriangavino45
Freshman I
Forum|alt.badge.img

Hi!

I'm trying to build a simple GI so that a client can easily review which customer have been added to a Group or groups.

Any ideas?

Thanks in advance!

Regards.

Best answer by BenjaminCrisman

@adriangavino45 If your customer is part of multiple groups then the restriction group value will change to be a combination of the values:

So if one GroupMask was 0x80000000 and another was 0x00600000 then if one entity was in both groups their mask would look like 0x80600000, which can be difficult to pull apart and I’m not certain how it would look if one group is letters and another is numbers, I have little experience trying to make GIs based off restriction groups, mainly because of the difficulty it can be.

If you know all the combinations of groups though then it could make a GI easier by using like a Switch() function.

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

14 replies

jamesh
Semi-Pro I
Forum|alt.badge.img+7
  • Semi-Pro I
  • 172 replies
  • February 6, 2024

There’s an out of the box GI called Restriction Groups by Customer that could give you the inverse of AR201000.  It’s ScreenId AR102010.

How would you like the data displayed?


adriangavino45
Freshman I
Forum|alt.badge.img
  • Author
  • Freshman I
  • 21 replies
  • February 6, 2024

Thanks for your suggestion James!

The real issue is because this client has more than 1,000 customers, and review one by one is not helpful, that's why we need to create a GI in order to review all the customers whit their restriction group assigned.

Regards!

 


jamesh
Semi-Pro I
Forum|alt.badge.img+7
  • Semi-Pro I
  • 172 replies
  • February 6, 2024

Here’s a very simple one I threw together.  You’ll probably want to throw in some additional fields or adjust it for your use case.  ;)

You’ll need to make sure the user viewing it has appropriate rights to view all the restriction groups or it will be incomplete information.

 

Let me know if this helps.


adriangavino45
Freshman I
Forum|alt.badge.img
  • Author
  • Freshman I
  • 21 replies
  • February 6, 2024

Thanks James!

I have already reviewed the GI you send me (I had already tried it that way), however it presents incorrect information, for example:

The customer CONDUCTORA ELECTRICA only has 4 restriction groups selected.

 

But the GI show me the customer -CONDUCTORA ELECTRICA- repeated for every restriction group that exists.

 

 

Regards!


jamesh
Semi-Pro I
Forum|alt.badge.img+7
  • Semi-Pro I
  • 172 replies
  • February 6, 2024

 I see…  Let’s take a slightly different approach - The Wyatt Erp Approach…

Acumatica stores the Group information in a table called RelationGroup.  It stores what object is part of each Group Restriction information on the records themselves.  In your case, that would be the Account and Sub tables.  It stores this in the GroupMask field, which is present on each of these tables as well as any others that can be a part of a group (BAccount, InventoryItem, etc.).  All of the GroupMask fields are stored in the DB as a varbinary type (which is basically a list of 1s and 0s).  This lets them store multiple pieces of information in the same field, and they use bitwise Math to get the values out.

The simplest way to check if a record is in a restriction group:

Make a Relation.  Customer is Parent, RelationGroup is Child

Include the fields you want in Results Grid.  Add this line:

=CInt((CLong([Customer.GroupMask])%(CLong([RelationGroup.GroupMask])*2))/CLong([RelationGroup.GroupMask]))

This field will now return a 1 if the Customer is part of "YourGroupName" or a 0 if it isn't. 

I don't have them written out for the A, A Inverse, B, B Inverse types, but if you want to take this further, then check out RelationGroup.GroupType.

 

The results will return a GI that looks something like this:
Where you have the customer name, the group name and a 1 or 0 as a true/false as to whether or not there’s a membership there. 

In the tables, you’ll want to create an alias for each RelationGroup you have:
 

For the Relations, you’ll want to add a relationship for each group name to each alias as follows:

I’ve only included 3 here, but as you can see, they’ll add up depending on how many restriction groups you have.  In your results grid, you’ll want it to look something like this:
 

 

You can call out these groups by joining them to any other table that’s restricted as well, and get similar results using the same structure.  

I’ve attached a sanitized version of the GI where you’ll just need to add in your groups and add more tables/aliases as needed.  Hopefully this solves your dilemma.  ;) 

Have fun!

James


adriangavino45
Freshman I
Forum|alt.badge.img
  • Author
  • Freshman I
  • 21 replies
  • February 8, 2024

Hi James! 

Thanks! I did some tests with 3 groups and the GI returns 0 and 1 as you said, but unfortunately it doesn't seem to work either, for example, the GI for the “erika” group shows me 40 records, but the group has more than 800 customers in it.

 

 

Same case with “GERARDO” group, if I filter by his formula only number 1, return 0 lines, but GERARDO has about 98 customers assigned.

 

 

 

 

Regards!


jamesh
Semi-Pro I
Forum|alt.badge.img+7
  • Semi-Pro I
  • 172 replies
  • February 8, 2024

Interesting…. I didn’t have that same experience with this… Is your GI limiting results to X amount of records?  Are you using multiple group types other than GroupType ‘A’? I.E.: inverse groups?


adriangavino45
Freshman I
Forum|alt.badge.img
  • Author
  • Freshman I
  • 21 replies
  • February 8, 2024

There's no limit in the number of records in the GI.

The customer only uses Group Type ‘A’.

 

The GI shows the 2891 customers, that it's the same that the number of customers in the GI ‘Customers’

 

 

Regards.


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2621 replies
  • March 27, 2024

Hi @adriangavino45 were you able to find a solution? Thank you!


BenjaminCrisman
Acumatica Employee
Forum|alt.badge.img+4
  • Acumatica Support Team
  • 625 replies
  • March 28, 2024

@adriangavino45 For this issue are there any customers which are in more than one group? Maybe that’s a difference between what you and James are seeing?


adriangavino45
Freshman I
Forum|alt.badge.img

Hi @Chris Hackett Not yet, I still have the same result and I have not been able to find the solution.

Regards.


adriangavino45
Freshman I
Forum|alt.badge.img

Hi @BenjaminCrisman yes, there are customers who are in different groups.

I have tried and researched for a long time, but I don't have a correct result in the GI.

Regards.


BenjaminCrisman
Acumatica Employee
Forum|alt.badge.img+4
  • Acumatica Support Team
  • 625 replies
  • Answer
  • April 3, 2024

@adriangavino45 If your customer is part of multiple groups then the restriction group value will change to be a combination of the values:

So if one GroupMask was 0x80000000 and another was 0x00600000 then if one entity was in both groups their mask would look like 0x80600000, which can be difficult to pull apart and I’m not certain how it would look if one group is letters and another is numbers, I have little experience trying to make GIs based off restriction groups, mainly because of the difficulty it can be.

If you know all the combinations of groups though then it could make a GI easier by using like a Switch() function.


adriangavino45
Freshman I
Forum|alt.badge.img

Yes, I agree with you, there are many combinations that makes creating this GI practically impossible. First I must know all the combinations, second, if you keep adding and/or modifying the groups the combinations will never be the same.

Thank you very much to everyone for your effort and support on this topic!


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