<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Conditional Expression  OR security trimming controls</title><link>https://www.infopathdev.com:443/forums/thread/54903.aspx</link><pubDate>Fri, 14 May 2010 17:24:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:54903</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/54903.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=54903</wfw:commentRss><description>&lt;p&gt;Yes, it will work if there is any match in the list, and there&amp;#39;s no need to use that translate() hack.&amp;nbsp; The msxsl:string-compare is there to perform a case-insensitive string comparison.&lt;/p&gt;</description></item><item><title>Re: Conditional Expression  OR security trimming controls</title><link>https://www.infopathdev.com:443/forums/thread/54902.aspx</link><pubDate>Fri, 14 May 2010 16:52:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:54902</guid><dc:creator>tawright</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/54902.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=54902</wfw:commentRss><description>&lt;p&gt;No however I did change it a little to:&lt;/p&gt;
&lt;p&gt;not(dfs:myFields/dfs:dataFields/dfs:SustainApprovers/@Person[msxsl:string-compare(., translate(/my:myFields/my:MyCurrentUser, &amp;quot;abcdefghijklmnopqrstuvwyxz&amp;quot;, &amp;quot;ABCDEFGHIJKLMNOPQRSTUVWYXZ&amp;quot;), &amp;quot;&amp;quot;, &amp;quot;i&amp;quot;) = 0])&lt;/p&gt;
&lt;p&gt;I need to change MyCurrentUser to lower case so that it will match...or does that not matter? &lt;/p&gt;
&lt;p&gt;Will this still read in all the rows from the custom list to see if there are any matches.....or do I need to include the double eval? &lt;/p&gt;</description></item><item><title>Re: Conditional Expression  OR security trimming controls</title><link>https://www.infopathdev.com:443/forums/thread/54901.aspx</link><pubDate>Fri, 14 May 2010 16:31:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:54901</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/54901.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=54901</wfw:commentRss><description>&lt;p&gt;Please try this formula:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;not(SustainApprovers/@Person[msxsl:string-compare(., MyCurrentUser, &amp;#39;&amp;#39;, &amp;#39;i&amp;#39;) = 0])&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;You&amp;#39;ll of course need to provide the full paths to @Person and MyCurrentUser, not these simplified versions.&lt;/p&gt;</description></item><item><title>Conditional Expression  OR security trimming controls</title><link>https://www.infopathdev.com:443/forums/thread/54893.aspx</link><pubDate>Fri, 14 May 2010 15:01:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:54893</guid><dc:creator>tawright</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/54893.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=54893</wfw:commentRss><description>&lt;p&gt;Not sure if this goes under code or controls.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the situation I need to disable certain controls on my for based on user that is logged on to the PC.&amp;nbsp; So in my for load event I have some code that gets the users AccountName and puts it in a textbox:&lt;br /&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; root = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.MainDataSource.CreateNavigator();&lt;br /&gt;GetUserInfoWS.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;UserProfileService&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; profileService = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; sustainabilityForm.GetUserInfoWS.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;UserProfileService&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;();&lt;br /&gt;profileService.UseDefaultCredentials = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;br /&gt;GetUserInfoWS.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;PropertyData&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;[] userProps = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;try&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;{&lt;br /&gt;userProps = profileService.GetUserProfileByName(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;catch&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; { }&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (userProps == &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; || userProps.Length == 0) &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;return&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;br /&gt;GetUserInfoWS.&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;ValueData&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;[] values = userProps[1].Values;&lt;br /&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; node = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;;&lt;br /&gt;node = root.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:myFields/my:MyCurrentUser&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;br /&gt;node.SetValue(values[0].Value.ToString());&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Then on the controls that need to be disabled I have a conditional&amp;nbsp;condition that compares what I have in the textbox with what is in a custom list I created called SustainApprovers...like this:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;MyCurrentUser is not equal to translate(eval(eval(SustainApprovers, &amp;quot;@Person&amp;quot;), &amp;quot;..&amp;quot;), &amp;quot;abcdefghijklmnopqrstuvwyxz&amp;quot;, &amp;quot;ABCDEFGHIJKLMNOPQRSTUVWYXZ&amp;quot;)&lt;/p&gt;
&lt;p&gt;Okay so here is the problem.&amp;nbsp; If I have the second part of the condition as translate(my:myFields/my:dataFields/my:Person,&amp;nbsp;&amp;quot;abcdefghijklmnopqrstuvwyxz&amp;quot;, &amp;quot;ABCDEFGHIJKLMNOPQRSTUVWYXZ&amp;quot;) It does not go through the the custom list and query each row, it only looks at the top row....so I added in the double eval and while this gets the whole list it still does not equal true.&amp;nbsp; Is there a better way to security trim controls in InfoPath? &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks&lt;/p&gt;
&lt;p&gt;Tom&lt;br /&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;</description></item></channel></rss>