<?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 : Verifier&lt;&gt; error messages</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Verifier&lt;&gt; error messages</description>
  <pubDate>Wed, 10 Jun 2026 17:29:37 -700</pubDate>
  <lastBuildDate>Tue, 07 Sep 2010 06:36:23 -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=2093</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>Verifier&lt;&gt; error messages : Ah, that is what I missed. I can...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2093&amp;PID=8381#8381</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=386" rel="nofollow">BrooksAdair</a><br /><strong>Subject:</strong> 2093<br /><strong>Posted:</strong> 07-Sep-2010 at 6:36am<br /><br />Ah, that is what I missed. I can change the message when returning the VerifierResult. Thank you.]]>
   </description>
   <pubDate>Tue, 07 Sep 2010 06:36:23 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2093&amp;PID=8381#8381</guid>
  </item> 
  <item>
   <title>Verifier&lt;&gt; error messages : How we can Bind When We have to...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2093&amp;PID=8370#8370</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=896" rel="nofollow">bala</a><br /><strong>Subject:</strong> 2093<br /><strong>Posted:</strong> 06-Sep-2010 at 4:42am<br /><br />How we can Bind When We have to do validation with text Box<DIV>&nbsp;</DIV><DIV>I write code but need to validate&nbsp; before entering data&nbsp; I am able to fire </DIV><DIV>validation.</DIV>]]>
   </description>
   <pubDate>Mon, 06 Sep 2010 04:42:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2093&amp;PID=8370#8370</guid>
  </item> 
  <item>
   <title>Verifier&lt;&gt; error messages : Additional notes:When you execute...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2093&amp;PID=8318#8318</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2093<br /><strong>Posted:</strong> 01-Sep-2010 at 11:44am<br /><br />Additional notes:<div><br></div><div>When you execute an instance verification with VerifierEngine.execute(anEmployee), it returns a VerifierResultCollection that has a list of all the VerifierResult. You'll be able to grab the error message that comes back from a particular VerifierResult.</div>]]>
   </description>
   <pubDate>Wed, 01 Sep 2010 11:44:56 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2093&amp;PID=8318#8318</guid>
  </item> 
  <item>
   <title>Verifier&lt;&gt; error messages :  Brooks;Yes, all verifiers are...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2093&amp;PID=8317#8317</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2093<br /><strong>Posted:</strong> 01-Sep-2010 at 11:42am<br /><br /><div style=": rgb255, 255, 255; margin-left: 1px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; font-family: Verdana, Arial, Helvetica, sans-serif; color: rgb0, 0, 0; font-weight: normal; font-size: 12px; line-height: 1.4; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; -: n&#111;ne; ">Brooks;<div><br></div><div>Yes, all verifiers are immutable after being added to the verification engine.&nbsp;</div><div><br></div><div>One solution that I can think of is to create a DelegateVerifier of your own and put some logic in the VerifierCondition delegate that changes the error message depending on the Entity state.</div><div><br></div><div><div>private static Verifier GetBornBeforeHiredVerifier() {</div><div>&nbsp;&nbsp; &nbsp; &nbsp;string errorMessage = "Must be born before hired.";</div><div>&nbsp;&nbsp; &nbsp; &nbsp;string&#091;&#093; propertyNames = {Employee.PropertyMetadata.BirthDate.Name,&nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Employee.PropertyMetadata.HireDate.Name};</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp;DelegateVerifier&lt;Employee&gt; v = new DelegateVerifier&lt;Employee&gt;(errorMessage, BornBeforeHiredCondition);</div><div>&nbsp;&nbsp; &nbsp; &nbsp;v.AddTriggers(Employee.PropertyMetadata.BirthDate.Name, Employee.PropertyMetadata.HireDate.Name);</div><div>&nbsp;&nbsp; &nbsp; &nbsp;v.VerifierOptions.ExecutionModes = VerifierExecutionModes.InstanceAndOnAfterSetTriggers;</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp;return v;</div><div>&nbsp;&nbsp; &nbsp;}</div><div><br></div><div>&nbsp;&nbsp; &nbsp;private static VerifierResult BornBeforeHiredCondition(</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;Employee pEmp, TriggerContext pTriggerContext, VerifierContext pVerifierContext) {</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp;if (pTriggerContext != null &amp;&amp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pTriggerContext.Timing == TriggerTiming.BeforeSet) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;throw new VerifierException("BornBeforeHired verifier not implemented for Preset");</div><div>&nbsp;&nbsp; &nbsp; &nbsp;}</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp;string errorMessage;</div><div>&nbsp;&nbsp; &nbsp; &nbsp;switch (pEmp.EntityAspect.EntityState) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;case EntityState.Added:</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;errorMessage = EntityState.Added.ToString();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;case EntityState.AllButDetached:</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;errorMessage = EntityState.AllButDetached.ToString();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;case EntityState.AnyAddedModifiedOrDeleted:</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;errorMessage = EntityState.AnyAddedModifiedOrDeleted.ToString();</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;default:</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;errorMessage = "Default error message";</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;</div><div>&nbsp;&nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp;return new VerifierResult(pEmp.BirthDate &lt; pEmp.HireDate, errorMessage);</div><div>&nbsp;&nbsp; &nbsp;}</div></div><div><br></div><div>I hope this helps.</div></div>]]>
   </description>
   <pubDate>Wed, 01 Sep 2010 11:42:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2093&amp;PID=8317#8317</guid>
  </item> 
  <item>
   <title>Verifier&lt;&gt; error messages : I use that method when I have...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2093&amp;PID=8299#8299</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=386" rel="nofollow">BrooksAdair</a><br /><strong>Subject:</strong> 2093<br /><strong>Posted:</strong> 31-Aug-2010 at 2:42pm<br /><br />I use that method when I have static messages. My problem is that I have a dynamic message that changes based on the state of the Entity being validated. I have found that any attempt to change a message after it had been added to the verification engine fails.<br><br>Anything I can do for dynamic messages?<br>]]>
   </description>
   <pubDate>Tue, 31 Aug 2010 14:42:12 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2093&amp;PID=8299#8299</guid>
  </item> 
  <item>
   <title>Verifier&lt;&gt; error messages :  Brooks;We actually have a new...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2093&amp;PID=8274#8274</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2093<br /><strong>Posted:</strong> 30-Aug-2010 at 12:50pm<br /><br /><div style=": rgb255, 255, 255; margin-left: 1px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; font-family: Verdana, Arial, Helvetica, sans-serif; color: rgb0, 0, 0; font-weight: normal; font-size: 12px; line-height: 1.4; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; -: n&#111;ne; ">Brooks;<div><br></div><div>We actually have a new feature in DevForce 2010 that allows you to directly assign an error message to ErrorMessageInfo.ErrorMessage property. Please see code sample below.</div><div><br></div><div><div>private static Verifier GetBirthDateRangeVerifier() {</div><div>&nbsp;&nbsp; &nbsp; &nbsp;Verifier v = new DateTimeRangeVerifier(</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;typeof(Employee), &nbsp; &nbsp; &nbsp; // Type of the object being verified</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Employee.PropertyMetadata.BirthDate.Name, // Property trigger</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;false, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Non-null value is not required</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MinBirthDate, true, &nbsp; &nbsp; &nbsp;// starting min date (inclusive)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DateTime.Today.Subtract(new TimeSpan(16 * 365, 0, 0, 0, 0)), true); &nbsp; &nbsp;// (inclusive)</div><div><br></div><div>&nbsp;&nbsp; &nbsp;&nbsp;<b>&nbsp;v.VerifierArgs.ErrorMessageInfo.ErrorMessage =</b></div><div><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;"The BirthDate must fall in the 20th century or later; " +</b></div><div><b>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;"and Employee must be at least 16 years of age today.";</b></div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp;return v;</div><div>&nbsp;&nbsp; &nbsp;}</div></div><div><br></div><div>I hope this helps.</div></div>]]>
   </description>
   <pubDate>Mon, 30 Aug 2010 12:50:16 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2093&amp;PID=8274#8274</guid>
  </item> 
  <item>
   <title>Verifier&lt;&gt; error messages : I have a number of verifiers that...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2093&amp;PID=8181#8181</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=386" rel="nofollow">BrooksAdair</a><br /><strong>Subject:</strong> 2093<br /><strong>Posted:</strong> 25-Aug-2010 at 8:20am<br /><br />I have a number of verifiers that are subclasses of Verifier&lt;&gt;. In DevForce Classic I had overridden the Description property to create a dynamic error message based on the state of the item being verified. I have not been able to figure out how to do this in DevForce EF 2010. The verifiers ErrorMessageInfo property does not seem to be able to changed after the verifier has been added to the engine. All the properties on ErrorMessageInfo seem to be read only. How can this be done?<br>]]>
   </description>
   <pubDate>Wed, 25 Aug 2010 08:20:26 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2093&amp;PID=8181#8181</guid>
  </item> 
 </channel>
</rss>