{"id":1913,"date":"2012-02-03T12:10:58","date_gmt":"2012-02-03T12:10:58","guid":{"rendered":"https:\/\/www.wapshere.com\/missmiis\/?p=1913"},"modified":"2012-02-03T20:41:25","modified_gmt":"2012-02-03T20:41:25","slug":"rcdc-variables-and-using-them-to-scope-a-listview-or-identitypicker","status":"publish","type":"post","link":"https:\/\/www.wapshere.com\/missmiis\/rcdc-variables-and-using-them-to-scope-a-listview-or-identitypicker","title":{"rendered":"RCDC Variables, and using them to scope a ListView or IdentityPicker"},"content":{"rendered":"<p>I don&#8217;t know how many times I&#8217;ve used the <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/ee534918(WS.10).aspx\">RCDC documentation<\/a>, but somehow never noticed the bit on Environment Variables. Today however I was looking for a way to restrict the scope of a UocListView or UocIdentityPicker based on properties of the user being edited &#8211; and it turns out that you can reference any properties of the object using %Attribute<em>_AttributeName<\/em>%, then use it in a filter!<\/p>\n<p><!--more--><\/p>\n<p>My goal was to restrict\u00c2\u00a0available roles based on a user&#8217;s EmployeeType. My &#8220;Role&#8221; objects have an attribute called &#8220;SubType&#8221; which matches the EmployeeType.\u00c2\u00a0 All I have to do is filter with an xpath query that references &#8216;%Attribute_EmployeeType%&#8217;. The same filter works for a UocListView too.<\/p>\n<pre>&lt;my:Control my:Name=\"Role\" my:TypeName=\"UocIdentityPicker\" my:Caption=\"{Binding Source=schema, Path=Role.DisplayName}\" my:Description=\"{Binding Source=schema, Path=Role.Description}\"&gt;\r\n\t&lt;my:Properties&gt;\r\n\t\t&lt;my:Property my:Name=\"Required\" my:Value=\"false\"\/&gt;\r\n\t\t&lt;my:Property my:Name=\"Mode\" my:Value=\"SingleResult\"\/&gt;\r\n\t\t&lt;my:Property my:Name=\"ObjectTypes\" my:Value=\"Role\"\/&gt;\r\n\t\t&lt;my:Property my:Name=\"ColumnsToDisplay\" my:Value=\"DisplayName\"\/&gt;\r\n\t\t&lt;my:Property my:Name=\"AttributesToSearch\" my:Value=\"DisplayName\"\/&gt;\r\n\t\t<strong>&lt;my:Property my:Name=\"Filter\" my:Value=\"\/Role[SubType = '%Attribute_EmployeeType%']\"\/&gt;<\/strong>\r\n\t\t&lt;my:Property my:Name=\"ResultObjectType\" my:Value=\"Role\"\/&gt;\r\n\t\t&lt;my:Property my:Name=\"Value\" my:Value=\"{Binding Source=object, Path=Role, Mode=TwoWay}\"\/&gt;\r\n\t\t&lt;my:Property my:Name=\"ListViewTitle\" my:Value=\"Available Roles\"\/&gt;\r\n\t\t&lt;my:Property my:Name=\"PreviewTitle\" my:Value=\"Selected Roles\"\/&gt;\r\n\t\t&lt;my:Property my:Name=\"MainSearchScreenText\" my:Value=\"Search\"\/&gt;\r\n\t&lt;\/my:Properties&gt;\r\n&lt;\/my:Control&gt;<\/pre>\n<p>The other thing I figured out is that it is possible to pass an attribute value in the UsageKeywords property. This is an alternative method to the for UocIdentityPicker and displays the Search Scopes\u00c2\u00a0that have the specifed Usage Keyword.<\/p>\n<pre>               &lt;my:Property my:Name=\"UsageKeywords\" my:Value=\"%Attribute_EmployeeType%\"\/&gt;<\/pre>\n<p>Note: as pointed out by Eugene below this an Edit-RCDC function only as it uses the attribute value already committed to the object. We still wait in hope for a way to dynamically scope choices based on other values chosen in the current form&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I don&#8217;t know how many times I&#8217;ve used the RCDC documentation, but somehow never noticed the bit on Environment Variables. Today however I was looking for a way to restrict the scope of a UocListView or UocIdentityPicker based on properties of the user being edited &#8211; and it turns out that you can reference any&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":[]},"categories":[60,51],"tags":[],"class_list":["post-1913","post","type-post","status-publish","format-standard","hentry","category-fim-2010-r2","category-rcdc"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pkp1o-uR","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/1913","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/comments?post=1913"}],"version-history":[{"count":3,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/1913\/revisions"}],"predecessor-version":[{"id":1915,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/1913\/revisions\/1915"}],"wp:attachment":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/media?parent=1913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/categories?post=1913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/tags?post=1913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}