<?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 : When will the custom description be used?</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : When will the custom description be used?</description>
  <pubDate>Sat, 11 Apr 2026 23:56:23 -700</pubDate>
  <lastBuildDate>Wed, 07 Oct 2009 18:50:34 -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=1509</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>When will the custom description be used? : You can do just about anything...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1509&amp;PID=5597#5597</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 1509<br /><strong>Posted:</strong> 07-Oct-2009 at 6:50pm<br /><br />You can do just about anything with a delegate verifier. Here's one that makes the Title for an Employee required if the provided FirstName is less than two characters long.&nbsp; (I modified the delegate verifier example from the Code Samples in the Validation topic.)<br><br>&nbsp;&nbsp;&nbsp; #region Conditional Required Verifier<br><br>&nbsp;&nbsp;&nbsp; private static Verifier TitleRequiredIfFirstNameIsShort() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string description = "A Title is required if the first name is shorter than two characters.";<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DelegateVerifier&lt;Employee&gt; v =<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new DelegateVerifier&lt;Employee&gt;(description, TitleRequiredCondition);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v.AddTrigger(Employee.TitleEntityProperty.Name);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v.ExecutionModes = VerifierExecutionModes.InstanceAndOnPostsetTriggers;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return v;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; private static VerifierResult TitleRequiredCondition(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Employee pEmp, TriggerContext pTriggerContext,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VerifierContext pVerifierContext) {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (pTriggerContext != null &amp;&amp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // We are not checking the proposed value because don't expect to call it preset<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pTriggerContext.Timing == TriggerTiming.Preset) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new VerifierException("TitleRequired verifier not implemented for Preset");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bool isValid = true;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (pEmp.FirstName.Length &lt; 2 &amp;&amp; pEmp.Title == null) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isValid = false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new VerifierResult(isValid);<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; #endregion<br><br>]]>
   </description>
   <pubDate>Wed, 07 Oct 2009 18:50:34 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1509&amp;PID=5597#5597</guid>
  </item> 
  <item>
   <title>When will the custom description be used? : Thanks Greg, I suspected that...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1509&amp;PID=5591#5591</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=399" rel="nofollow">LesleySastro</a><br /><strong>Subject:</strong> 1509<br /><strong>Posted:</strong> 07-Oct-2009 at 8:54am<br /><br />Thanks Greg, I suspected that already. Setting the parameter to false will not help either, because the verifier will not run when the property is null, only when a value is entered for that property. So the big question is how to create a custom required verifier (one that will display my custom error message). For example, in your test when the country is USA the state should be a required property. ]]>
   </description>
   <pubDate>Wed, 07 Oct 2009 08:54:58 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1509&amp;PID=5591#5591</guid>
  </item> 
  <item>
   <title>When will the custom description be used? : I took your code and tweaked it...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1509&amp;PID=5589#5589</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=4" rel="nofollow">GregD</a><br /><strong>Subject:</strong> 1509<br /><strong>Posted:</strong> 06-Oct-2009 at 7:09pm<br /><br />I took your code and tweaked it into a Country verifier for the Customer entity of NorthwindIB. Any subsequent attempt to set the Country property to null (regardless of the value of the Action property) elicited a generic "Country is required" message (not your custom message). <br><br>So I set a break point inside your VerifyValue() method and found that it never runs. The null check is simply resulting from the <i>true </i>setting on the second parameter of your call to the PropertyValueVerifierArgs constructor):<br><br><br><font color="#0000ff" size="2"><font color="#0000ff" size="2">public</font></font><font size="2"> IdentificationNumberRequiredVerifier() </font><p><font size="2">: </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">base</font></font><font size="2"> ( </font><font color="#0000ff" size="2"><font color="#0000ff" size="2">new</font></font><font size="2"> </font><font color="#2b91af" size="2"><font color="#2b91af" size="2">PropertyValueVerifierArgs</font></font><font size="2">&lt;</font><font color="#2b91af" size="2"><font color="#2b91af" size="2">AccountMutation</font></font><font size="2">&gt;(</font></p><p><font size="2">IdentificationNumberEntityProperty.Name, </font><font color="#ff0000"><b><font size="2"><font size="2">true</font></font></b></font><font size="2">, </font><font color="#a31515" size="2"><font color="#a31515" size="2">"Identification Number"</font></font><font size="2">))</font></p><br><br>]]>
   </description>
   <pubDate>Tue, 06 Oct 2009 19:09:35 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1509&amp;PID=5589#5589</guid>
  </item> 
  <item>
   <title>When will the custom description be used? :  I have the following custom...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1509&amp;PID=5577#5577</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=399" rel="nofollow">LesleySastro</a><br /><strong>Subject:</strong> 1509<br /><strong>Posted:</strong> 05-Oct-2009 at 8:11am<br /><br /><DIV></DIV><DIV><FONT size=2>I have the following custom verifier (see below). The idea is that the IdentificationNumberEntityProperty is required under certain conditions. The custom description I&nbsp;wrote is never used. Any ideas why?&nbsp;</FONT></DIV><DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2><P>#region</FONT></FONT><FONT size=2> Identification Number</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>private</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>class</FONT></FONT><FONT size=2> </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>IdentificationNumberRequiredVerifier</FONT></FONT><FONT size=2> : </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>PropertyValueVerifier</FONT></FONT><FONT size=2>&lt;</FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>AccountMutation</FONT></FONT><FONT size=2>&gt;</P><P>{</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>public</FONT></FONT><FONT size=2> IdentificationNumberRequiredVerifier() </P><P>: </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>base</FONT></FONT><FONT size=2> ( </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>new</FONT></FONT><FONT size=2> </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>PropertyValueVerifierArgs</FONT></FONT><FONT size=2>&lt;</FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>AccountMutation</FONT></FONT><FONT size=2>&gt;(</P><P>IdentificationNumberEntityProperty.Name, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>true</FONT></FONT><FONT size=2>, </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"Identification Number"</FONT></FONT><FONT size=2>))</P><P>{</P><P>ExecutionModes = </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>VerifierExecutionModes</FONT></FONT><FONT size=2>.InstanceAndOnPostsetTriggers;</P><P>}</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>protected</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>override</FONT></FONT><FONT size=2> </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>VerifierResult</FONT></FONT><FONT size=2> VerifyValue(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>object</FONT></FONT><FONT size=2> itemToVerify, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>object</FONT></FONT><FONT size=2> valueToVerify, </P><P></FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>TriggerContext</FONT></FONT><FONT size=2> triggerContext, </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>VerifierContext</FONT></FONT><FONT size=2> verifierContext)</P><P>{</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> ((itemToVerify </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>is</FONT></FONT><FONT size=2> </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>AccountMutation</FONT></FONT><FONT size=2>) &amp;&amp; (</P><P>(((</FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>AccountMutation</FONT></FONT><FONT size=2>)itemToVerify).Action == 1) || </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// New Account</P></FONT></FONT><FONT size=2><P>(((</FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>AccountMutation</FONT></FONT><FONT size=2>)itemToVerify).Action == 2) || </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Change Personal Info</P></FONT></FONT><FONT size=2><P>(((</FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>AccountMutation</FONT></FONT><FONT size=2>)itemToVerify).Action == 5) || </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Change All Info</P></FONT></FONT><FONT size=2><P>(((</FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>AccountMutation</FONT></FONT><FONT size=2>)itemToVerify).Action == 7))) </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Reactivate Account</P></FONT></FONT><FONT size=2><P>{</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> ((valueToVerify == </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>null</FONT></FONT><FONT size=2>) || (</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>string</FONT></FONT><FONT size=2>.IsNullOrEmpty(valueToVerify.ToString().Trim())))</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>new</FONT></FONT><FONT size=2> </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>VerifierResult</FONT></FONT><FONT size=2>(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>false</FONT></FONT><FONT size=2>, Description);</P><P>}</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>new</FONT></FONT><FONT size=2> </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>VerifierResult</FONT></FONT><FONT size=2>(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>true</FONT></FONT><FONT size=2>);</P><P>}</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>protected</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>override</FONT></FONT><FONT size=2> </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>VerifierResult</FONT></FONT><FONT size=2> VerifyValueTyped(</FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>AccountMutation</FONT></FONT><FONT size=2> itemToVerify, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>object</FONT></FONT><FONT size=2> valueToVerify,</P><P></FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>TriggerContext</FONT></FONT><FONT size=2> triggerContext, </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>VerifierContext</FONT></FONT><FONT size=2> verifierContext)</P><P>{</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2> VerifyValue(itemToVerify, valueToVerify, triggerContext, verifierContext);</P><P>}</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>public</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>override</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>string</FONT></FONT><FONT size=2> Description</P><P>{</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>get</P></FONT></FONT><FONT size=2><P>{</P><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// TODO Localize</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2> </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"Identification Number is required. ***"</FONT></FONT><FONT size=2>;</P><P>}</P><P>}</P><P>}</P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2><P>#endregion</P></FONT></FONT></DIV>]]>
   </description>
   <pubDate>Mon, 05 Oct 2009 08:11:19 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1509&amp;PID=5577#5577</guid>
  </item> 
 </channel>
</rss>