Skip to main content
Solved

Subaccount Restriction Group on report

  • Apr 21, 2025 4:05 PM UTC
  • 3 replies
  • 126 views
  • Translate All

Forum|alt.badge.img

I have added these subaccount in the restriction group and i wanted to allow user to only see these in the reports during generation.
I also checked the apply restriction in report definition
 

It still shows all the subaccount in the list
 

 

Best answer by ron

I was able to solve this issue using customization
This is code
 

 public sealed class RMReportPmExt : PXCacheExtension<RMReport>
 {
     public static bool IsActive() => true;

     #region SubCD (Override selector with access restriction)
     [PXMergeAttributes(Method = MergeMethod.Replace)]
     [PXDimension("SUBACCOUNT")]
     [PXSelector(
         typeof(Search<Sub.subCD, Where<Match<Current<AccessInfo.userName>>>>),
         typeof(Sub.subCD),
         typeof(Sub.description)
     )]
     [PXString]
     public string SubCD
     {
         get => null;
         set { }
     }
     public abstract class subCD : BqlType<IBqlString, string>.Field<subCD>
     {
     }
     #endregion
 }

View original

3 replies

nhatnghetinh
Captain II
Forum|alt.badge.img+15

Hi ​@ron 

I tested and found that "Subaccounts by Branch Access" has restrictions on Transactions but reports have no restrictions.

 

 

 

 

 

Best Regards,

NNT

Translate

Forum|alt.badge.img
  • Author
  • Varsity I
  • Answer
  • Apr 23, 2025 6:18 PM UTC

I was able to solve this issue using customization
This is code
 

 public sealed class RMReportPmExt : PXCacheExtension<RMReport>
 {
     public static bool IsActive() => true;

     #region SubCD (Override selector with access restriction)
     [PXMergeAttributes(Method = MergeMethod.Replace)]
     [PXDimension("SUBACCOUNT")]
     [PXSelector(
         typeof(Search<Sub.subCD, Where<Match<Current<AccessInfo.userName>>>>),
         typeof(Sub.subCD),
         typeof(Sub.description)
     )]
     [PXString]
     public string SubCD
     {
         get => null;
         set { }
     }
     public abstract class subCD : BqlType<IBqlString, string>.Field<subCD>
     {
     }
     #endregion
 }

Translate

Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • Apr 24, 2025 1:36 AM UTC

Thank you for sharing your solution with the community ​@ron!

Translate