Skip to main content
Question

Conditionally required field not working -Customization Projects

  • January 17, 2023
  • 6 replies
  • 294 views

Forum|alt.badge.img

Hi guys, I created a condition called IsExempt below, the Tax Zone on a Customer record is set to PAEXEMPT

 

 

 

I then added the Tax Registration ID field and used the IsExempt condition in the Required column.

 

My expectation in doing this would be that whenever the TaxZoneID = PAEXEMPT then the Tax Reg field would be required, but this is not working and I need some guidance.  Thanks!

 

 

6 replies

Forum|alt.badge.img+1

Hi @dgross54,

Could you please check the below link:

https://stackoverflow.com/questions/31807310/how-to-make-field-conditionally-required-in-acumatica

 

 

I hope it helps you!

Moulali Shaik.


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 47 replies
  • January 17, 2023

UPdate: I tried the exact same thing for Customer Locations and it worked as expected.  I just don’t understand why it’s not working in the Customer screen.  Below is a comparison of the conditions, the only thing different is that the Customer Location condition differentiates between the Vendor (V) and the Customer (C).

 

 


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 47 replies
  • January 17, 2023

@MoulaliShaik79   Thanks but I am not a coder and this is 7 years old.  Acumatica built this to work, and it does except for this one.  This is the first time it has not worked for me.


jamesh
Semi-Pro I
Forum|alt.badge.img+7
  • Semi-Pro I
  • 177 replies
  • September 7, 2023
dgross54 wrote:

UPdate: I tried the exact same thing for Customer Locations and it worked as expected.  I just don’t understand why it’s not working in the Customer screen.  Below is a comparison of the conditions, the only thing different is that the Customer Location condition differentiates between the Vendor (V) and the Customer (C).

 

 

In looking at the DAC for this, it looks like the display name is just there to reference the separation of Customer vs Vendor.  I would try it again, but if it doesn’t work, I would submit a ticket to Acumatica for support.  

 

 


Keith Richardson
Semi-Pro I
Forum|alt.badge.img+2

The issue may be with the fact that the shipping tab’s tax zone actually refers to the default location. The options available in the dropdown are only available for the main DAC. 

I would add the following code into a Graph Extension of CustomerMaint to accomplish this.

 


    public class CustomerMaint_Extension : PXGraphExtension<CustomerMaint>
    {

        //declare constant for required value
        public const string PAExempt = "PAEXEMPT";
        public class pAExempt : PX.Data.BQL.BqlString.Constant<pAExempt> { public pAExempt() : base(PAExempt) {; } }

        //merge the following attributes to the cache attached field, taxRegistrationID
        [PXMergeAttributes(Method = MergeMethod.Merge)]
        //required for PXUIRequired
        [PXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
        //require if the default location's tax zone is PAEXEMPT
        [PXUIRequired(typeof(Where<Selector<Customer.defLocationID, Location.cTaxZoneID>, Equal<pAExempt>>))]
        public virtual void _(Events.CacheAttached<Customer.taxRegistrationID> e) { }
  }

 


  • Freshman I
  • 2 replies
  • May 24, 2024
Keith Richardson wrote:

The issue may be with the fact that the shipping tab’s tax zone actually refers to the default location. The options available in the dropdown are only available for the main DAC. 

I would add the following code into a Graph Extension of CustomerMaint to accomplish this.

 


    public class CustomerMaint_Extension : PXGraphExtension<CustomerMaint>
    {

        //declare constant for required value
        public const string PAExempt = "PAEXEMPT";
        public class pAExempt : PX.Data.BQL.BqlString.Constant<pAExempt> { public pAExempt() : base(PAExempt) {; } }

        //merge the following attributes to the cache attached field, taxRegistrationID
        [PXMergeAttributes(Method = MergeMethod.Merge)]
        //required for PXUIRequired
        [PXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
        //require if the default location's tax zone is PAEXEMPT
        [PXUIRequired(typeof(Where<Selector<Customer.defLocationID, Location.cTaxZoneID>, Equal<pAExempt>>))]
        public virtual void _(Events.CacheAttached<Customer.taxRegistrationID> e) { }
  }

 

This code is not work


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