Question

Conditionally required field not working -Customization Projects

  • 17 January 2023
  • 5 replies
  • 159 views

Userlevel 3
Badge

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!

 

 


5 replies

Userlevel 4
Badge +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.

Userlevel 3
Badge

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).

 

 

Userlevel 3
Badge

@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.

Userlevel 6
Badge +6

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.  

 

 

Userlevel 4
Badge +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) { }
}

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved