Skip to main content
Answer

Subaccount Restriction Group on report

  • April 21, 2025
  • 3 replies
  • 68 views

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
 }

3 replies

nhatnghetinh
Captain II
Forum|alt.badge.img+11
  • Captain II
  • April 22, 2025

Hi ​@ron 

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

 

 

 

 

 

Best Regards,

NNT


Forum|alt.badge.img
  • Author
  • Varsity I
  • Answer
  • April 23, 2025

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
 }


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • April 24, 2025

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