I have been able to add a custom field to SO301000. I am struggling with how to show/hide the custom field based on the Order Type field. I tried to create an event handler based on the RowSelected event. But, I failed. My edit hid the field always, and left the label visible always.
Can anyone point me in the right direction?
The best way to learn is to have someone pick apart your failed attempts
Can you post the code you tried?
In the meantime, something like this should work, placed on the custom field’s attributes:
"PXUIVisible(typeof(Where<SOOrder.orderType.IsEqual<SOOrderTypeConstants.salesOrder>>))]
Hi rcreasy
In case you’re interested in a low / no code method.
We sometimes use Conditions and then apply that to the fields “Hidden” property. See the screenshot below for an example.


Hi,
As you mentioned, the RowSelected code did not work, can you please share the code here?
In re-reading my post, I think I didn’t explain my need very well. I need to conditionally display my custom field only when a specific order type (“NC”) is selected.
Thanks for everyone’s patience with me as I learn.
If SOOrderTypeConstants doesn’t have the required value you need, you can define a constant of your own like this:
public class ncOrder : PX.Data.BQL.BqlString.Constant<ncOrder>
{
public ncOrder() : base("NC") { }
}
Then use ncOrder in the statement:
ePXUIVisible(typeof(Where<SOOrder.orderType.IsEqual<ncOrder>>))]
Do you mind pointing me to info or explaining:
public ncOrder() : base("NC") { }
This is my understanding:
this defines the class ncOrder, which inherits the BqlString.Contant class
public class ncOrder : PX.Data.BQL.BqlString.Constant<ncOrder>
{
}
this overrides the base constructor with a new string value
public ncOrder() : base("NC") { }
This may not be entirely technically correct, but the result is a BQL constant from a string.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.