Nintex Object Model (Required Field validator to custom properties)

Background: It almost take 2 days to find the way to apply the required field validator to the custom control properties. So I decided to share with this information to all other fobs working with Nintex object model.

Goal: Apply Required Field validator to custom properties.


So apply the required field validator we need to put the following code at the top of the properties attribute section.

Required(ErrorMessageResourceType = typeof(Core), ErrorMessageResourceName = "ValidationFieldRequired")

So the full code would be goes like this. The marked yellow are required parameters to make the fields to required. 

[ControlPropertyInfo(ResourceType = typeof(Core),
DisplayName = "MyRrequiredField",
GroupName = "Rrequired",
DisplayOrder = 6,
Required = true,
ChangeAction = ControlPropertyChangeActionType.DoNothing,
TextMode = PropertyTextMode.MultiLine),
Required(ErrorMessageResourceType = typeof(Core), ErrorMessageResourceName = "ValidationFieldRequired"),
DataMember]
public string MyRrequiredField{ get; set; }

To more about the nintex object model please go through with my other posts.
  1. Nintex Form Object Model 2013: Render various types of properties
  2. Nintex Custom Ribbon Control 2013 - Implementation Example (Custom Action)

Popular posts from this blog

SharePoint RPC Protocols Examples Using OWSSVR.DLL

STS CryptographicException Error : Key set does not exist

SharePoint 2013 Search =>Increase CutoffMaxBuckets size of the refiner