<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Custom validation</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : Community Forum : Custom validation</description>
  <pubDate>Sat, 18 Apr 2026 02:06:37 -700</pubDate>
  <lastBuildDate>Tue, 01 May 2012 16:35:30 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=3418</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Custom validation :   Unfortunatley, the VerifierResult...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3418&amp;PID=13468#13468</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3418<br /><strong>Posted:</strong> 01-May-2012 at 4:35pm<br /><br />Unfortunatley, the VerifierResult class doesn't have a constructor that takes the TargetInstance or a public setter for the TargetInstance property. The setter is internal, so there's currently no way to specify the entity. I suggest you post a feature request to the Data Verification forum.<div>&nbsp;</div><div><a href="http://www.ideablade.com/forum/forum_topics.asp?FID=26&amp;title=data-verificati&#111;n-validati&#111;n" target="_blank"><u><font color="#0066cc">http://www.ideablade.com/forum/forum_topics.asp?FID=26&amp;title=data-verification-validation</font></u></a></div>]]>
   </description>
   <pubDate>Tue, 01 May 2012 16:35:30 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3418&amp;PID=13468#13468</guid>
  </item> 
  <item>
   <title>Custom validation : How to inform the user about the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3418&amp;PID=13467#13467</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1440" rel="nofollow">giotis</a><br /><strong>Subject:</strong> 3418<br /><strong>Posted:</strong> 01-May-2012 at 4:19pm<br /><br />How to inform the user about the name of entity of field]]>
   </description>
   <pubDate>Tue, 01 May 2012 16:19:58 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3418&amp;PID=13467#13467</guid>
  </item> 
  <item>
   <title>Custom validation : When we add a new StaffingResource...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3418&amp;PID=13466#13466</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1440" rel="nofollow">giotis</a><br /><strong>Subject:</strong> 3418<br /><strong>Posted:</strong> 01-May-2012 at 4:11pm<br /><br />When we add a new StaffingResource and after save without fill appropriate Address fields then raise an exception<br>if we put a breakpoint in ValidationErrorHandler the validationErrors return a VerifierResult collection <br>So we see that custom Verifier type is null<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#091;DataContract&#093;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#091;DebuggerDisplay("{ResultCode}; {Message}; {Verifier.ApplicableType}")&#093;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; public class VerifierResult&nbsp;&nbsp; {<br><br>validationErrors = { &#091;0&#093; ...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &#091;1&#093; = Error; "The Address1 field is required."; {DomainModel.Address}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#091;5&#093; = Error; "The State field is required"; null<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>namespace Common.Validation{<br>&nbsp;&nbsp;&nbsp; public class ValidationErrorHandler : IValidationErrorNotification&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void OnValidationError(VerifierResultCollection validationErrors)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (validationErrors.HasErrors)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#FF0000"> EventFns.Publish(new ValidationErrorMessage(validationErrors));</font><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>} <br>]]>
   </description>
   <pubDate>Tue, 01 May 2012 16:11:44 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3418&amp;PID=13466#13466</guid>
  </item> 
  <item>
   <title>Custom validation :   Can you provide some more...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3418&amp;PID=13465#13465</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3418<br /><strong>Posted:</strong> 01-May-2012 at 9:17am<br /><br />Can you provide some more information on your first issue?<div>&nbsp;</div><div>On your second point. Custom validation is needed here, because StateId and State will always have a value assigned. If you don't explicitly set StateId it will be&nbsp;initialized with Guid.Empty() and State will be initialized with the null entity not the null value. The RequiredAttribute is a .NET attribute that doesn't understand the null entity. It looks for a null value. So, the two options are doing what I'm doing or put a DevForce Verifier on the State property, which understands the null entity.</div><div>&nbsp;</div><div>One of the key features in DevForce is that navigation properties are never null, to avoid NullReferenceExceptions when binding to the UI. You can learn more about this topic here:</div><div>&nbsp;</div><div><a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/null-entity" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/null-entity</a></div>]]>
   </description>
   <pubDate>Tue, 01 May 2012 09:17:44 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3418&amp;PID=13465#13465</guid>
  </item> 
  <item>
   <title>Custom validation : Dear friends ,  exploring the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3418&amp;PID=13464#13464</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1440" rel="nofollow">giotis</a><br /><strong>Subject:</strong> 3418<br /><strong>Posted:</strong> 01-May-2012 at 2:22am<br /><br />Dear friends , <br>exploring the ValidationErrorMessageProcessor I noticed that only inform the user about the error field and not the <br>named entity in ValidationErrorsView and I decided to include this information but I found two things,<br><br>1. when we add our own custom validations not updated the {Verifier.ApplicableType}<br>&nbsp;&nbsp;&nbsp; which keeps the information of the entity<br><br>2. Since fields they have <font color="#0066FF">RequiredAttribute </font>why require extra custom validation?<br><br>&nbsp;&nbsp;&nbsp; namespace DomainModel {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#091;DataContract(IsReference = true)&#093;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public class Address : AuditEntityBase, IHasRoot&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; internal Address()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;summary&gt;Gets or sets the StateId. &lt;/summary&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#091;DataMember&#093;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &#091;<font color="#0066FF">Required</font>&#093;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; public Guid StateId { get; set; }<br>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /// &lt;summary&gt;Gets or sets the State. &lt;/summary&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#091;DataMember&#093;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#091;<font color="#0066FF">Required</font>&#093;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public State State { get; set; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#0066FF">public override void</font> Validate(<font color="#006600">VerifierResultCollection </font>validationErrors)&nbsp;&nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (State.EntityFacts.EntityAspect.IsNullOrPendingEntity) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; validationErrors.Add(new <font color="#006600">VerifierResult</font>(<font color="#006600">VerifierResultCode</font>.Error, "The State field is required", "State"));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp; &nbsp; }<br><br>best regards]]>
   </description>
   <pubDate>Tue, 01 May 2012 02:22:54 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3418&amp;PID=13464#13464</guid>
  </item> 
 </channel>
</rss>