次の方法で共有


Nice trick to enforce certain rules on Area Path and Iteration Path

I have heard this feature request so many times: Requiring at least N levels of nodes for Area Path and Iteration Path fields. Unfortunately we AreaPath and IterationPath can not take any rules and it is a limitation. My program manager Gregg showed me this nice trick to workaround this problem:

  <FIELD name="Iteration Path - Validation" refname="MyFields.IterationPathValidation" type="String">
   <HELPTEXT>Hidden field used to validate Iteration Path</HELPTEXT>
   <WHEN field="System.IterationId" value="XX">
    <COPY from="value" value="Restricted" />
   </WHEN>
   <PROHIBITEDVALUES not = "[project]\Project Administrators">
    <LISTITEM value="Restricted"/>
   </PROHIBITEDVALUES>
  </FIELD>

Where XX is the Iteration ID of the root level node. Change Iteration to Area for Area Path field. So if you want to prevent users specifying just root node as AreaPath or IterationPath, put the project name (root) there and users will get an error message that "Iteration Path - Validation has invalid value". We are working on improving this area for future releases.

[Update 8/6/07] I saw post from Paul Chapman on msdn-wiki post on this: https://msdn2.microsoft.com/en-us/library/ms181480(VS.80).aspx#CommunityContent