Skip to main content
I need to override the accountattribute so that it accepts inactive accounts, how do I do this, currently the restrictors I want to remove…..

 

     PXDBInt]
    >PXInt]
    PXRestrictorAttribute(typeof(Where<Account.active, Equal<True>>), "Account is inactive.", newv] { })]
    bPXRestrictorAttribute(typeof(Where<Where<Current<GLSetup.ytdNetIncAccountID>, IsNull, Or<Account.accountID, NotEqual<Current<GLSetup.ytdNetIncAccountID>>>>>), "YTD Net Income Account cannot be used in this context.", newt] { })]
    ]PXUIField(DisplayName = "Account", Visibility = PXUIVisibility.Visible, FieldClass = "ACCOUNT")]
   

public class AccountAttribute : AcctSubAttribute, IPXFieldVerifyingSubscriber, IPXRowPersistingSubscriber
    {
        public const string DimensionName = "ACCOUNT";

        public AccountAttribute();

 

 

 

Hi @gparrales50  You can write a CacheAttached event with the gPXRemoveBaseAttribute(typeof(PXRestrictorAttribute))] 

 

Below is the sample example for reference.

 

 oPXMergeAttributes(Method = MergeMethod.Merge)]

        PXRemoveBaseAttribute(typeof(PXRestrictorAttribute))]
        /CustomerActive]

        protected virtual void SOOrder_CustomerID_CacheAttached(PXCache cache)
        {
        }

 


 

 

For some reason the removebaseattribute does not work, since it is implemented by a class, from what I understand, by placing the eAccount] attribute the restrict of the AccountId field of the Account Table is triggered

 

CustomClass

 

 


Hi @gparrales50  It seems Account] attribute is decorated with the PXRestrictor. Please find the screenshot

 

 


Thanks @Naveen Boga ,

 

Exactly, that's why I think the PXRemoveBaseAttribute doesn't work for me, how can I bypass that restriction?


Reply