Question

How to set up a field is required when it meets specific condition?

  • 3 April 2024
  • 5 replies
  • 55 views

Userlevel 3
Badge

Hi All, 

I want to set up the required input project if the warehouse is "PENDING."

I set it up like below, but it's not working; even if the field Project is marked with an asterisk or star, the system still allows it to save.

Please advise where I am wrong

 

 


5 replies

Userlevel 7
Badge +10

Hi @dilys 

You have a couple of options.  First, you could start a support case with either your partner or Acumatica directly to confirm if it is a bug.  This would let Acumatica know about the issue quicker so it can be resolved in a future build.

Second, you or your partner could write a customization package (or hire a developer) to override Acumatica code to make it work.

Best,

 

David

 

Userlevel 4
Badge

Hi @dilys,

Have you tried to set the CommitChanges = true for Warehouse ID field?

Also I believe you need to set Repaint Columns = true for the Location table grid which refreshes the grid.

If above solution does not works then you need to do customization(code) to works it as expected.

Userlevel 3
Badge

Hi @dilys,

Have you tried to set the CommitChanges = true for Warehouse ID field?

Also I believe you need to set Repaint Columns = true for the Location table grid which refreshes the grid.

If above solution does not works then you need to do customization(code) to works it as expected.

I tried the way you told me, but it’s still the same, do you have any idea?

 

Userlevel 4
Badge

Hi @dilys,

If above approaches does not work, you need to throw PXException on row persisting event.

e.g.

protected void RowPersisting(PXCache cache, PXRowPersistingEventArgs e)
{
if (e.Row == null) return;
var row = e.Row;
if (row.siteID == "PEDNING")
{
throw new Exception("Project is Required");

}
}

If you are not familiar with customization, This link can be push you into right direction to get desired result.

Userlevel 3
Badge

Hi @dilys,

If above approaches does not work, you need to throw PXException on row persisting event.

e.g.

protected void RowPersisting(PXCache cache, PXRowPersistingEventArgs e)
{
if (e.Row == null) return;
var row = e.Row;
if (row.siteID == "PEDNING")
{
throw new Exception("Project is Required");

}
}

If you are not familiar with customization, This link can be push you into right direction to get desired result.

Thanks for your help

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