I want to forcefully input Data in UpperCase Only
Page 1 / 1
Hi
If it’s your custom field - I’d try first to change the setter:
public string Field
{
get
{
return Field;
}
set
{
Field = value.ToUpper();
}
}
For standard field - you can create a Graph Extension, define an event handler (FieldUpdating
) and change the case:
protected virtual void _(Events.FieldUpdating<YourDac.field> e)
{
if (!(e.NewValue is string newValue))
return;
e.NewValue = newValue.ToUpper();
}
You could also go with the trigger in the database, but I’d say doing it in code is more preferable.
I can also see different solution for the similar question at the Stack Overflow, maybe you like it more.
Hi
You can use the InputMask
property in your DAC declaration of the field to ensure that data is entered according to your desired format
You can use it lIke
>PXDBString(6, IsKey = true, InputMask = ">CCCCCC")]
hope, it helps!
[PXDBString(6, IsKey = true, InputMask = ">CCCCCC")]
This
Thanks a lot, guys. It worked for me
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.