You can make it an error instead of a warning(on the Order Type page) but there isn’t an out-of-the-box way to make it a popup instead.
If you go the customization route it looks like the business logic is implemented via a CustomerOrderNbrAttribute(could be different depending on your version) so you could extend that attribute and add a popup if the field has an error set and then override the attribute on the CustomerOrderNbr field with your custom one.
Below is a quick code sample
public class SOOrderEntryExt: PXGraphExtension<SOOrderEntry> {
public static bool IsActive() => true;
PXMergeAttributes(Method = MergeMethod.Merge)]
CustomerOrderNbrExt]
public void _(Events.CacheAttached<SOOrder.customerOrderNbr> e) { }
}
public class CustomerOrderNbrExtAttribute: CustomerOrderNbrAttribute
{
public override void FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
{
base.FieldVerifying(sender, e);
HandlePopup(sender, (SOOrder)e.Row);
}
public override void RowUpdated(PXCache sender, PXRowUpdatedEventArgs e)
{
base.RowUpdated(sender, e);
HandlePopup(sender, (SOOrder)e.Row);
}
private void HandlePopup(PXCache cache, SOOrder order)
{
if (order == null) return;
if (string.IsNullOrEmpty(order.CustomerOrderNbr)) return;
var fieldState = GetFieldState(cache, order);
RegisterPopupIfInError(fieldState, cache, order);
}
private PXFieldState GetFieldState(PXCache cache, SOOrder order)
{
return cache.GetStateExt<SOOrder.customerOrderNbr>(order) as PXFieldState;
}
private void RegisterPopupIfInError(PXFieldState fieldState, PXCache cache, SOOrder order)
{
if (fieldState?.Error != null)
{
PopupNoteManager.RegisterText(cache, order, nameof(SOOrder.customerOrderNbr), fieldState.Error);
}
}
}
You can make it an error instead of a warning(on the Order Type page) but there isn’t an out-of-the-box way to make it a popup instead.
Below is a quick code sample
Hello and thank you for taking the time out of your day to response and help.
When you say “make it an error” does that mean, it completely negates the possibility of it being duplicated? We do have customers that use ABC123 as a blanket order number over and over so I’m not sure that we want to completely disable the ability to use a duplicate customer PO#. We just want it to be significantly more noticeable.
Unfortunately, for me, I do not understand the coding portion of this (as it is not my forte) but will talk this over with our coding guy and see if this is a viable solution.
Thanks again so much!
Yeah an error would prevent saving if the customer order number is exactly the same. You could obviously add an _ or something innocuous to bypass that though.