PXUIRequired attribute usage in Acumatica

Hello everybody,

today I want to say a bit more about usage of attribute PXUIRequired as previous article on my blog wasn't very easy to follow by some of my readers.

Take a look on presented code sample:

public class sOOrderType : Constant<string>
{
	public const string SOOrderType = "SO";
	public sOOrderType() : base(SOOrderType)
	{	
	}
}
 
public class SOOrderExt : PXCacheExtension<SOOrder>
{
	[PXMergeAttributes(Method = MergeMethod.Append)]
	[PXDefault]
	[PXUIRequired(typeof(Where<SOOrder.orderTypeEqual<sOOrderType>>))]
	public virtual string CustomerOrderNbr { getset; }
}

As you can see, besides attribute PXUIRequired it has declaration of constant value "SO". With that declaration before class you may get validation only for SO Order type "SO".

And now as you see on screenshot, field Customer Order got it's star. Take notice that color of that star is also differnet, it become red.

One more point which I want to underline, attribute PXUIRequired will work in connection with PXDefault attriubute. Without PXDefault attribute you'll get another error message, so as as summary, use PXUIRequired attribute with PXDefault.

No Comments

Add a Comment