Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Answer edited to include the getting the user fullname if sql source is used.</p> <ol> <li><p>Register a parameter, UserID, with default value as </p> <p>=User!UserID</p></li> <li><p>Use the following query in your dataset</p> <p>SELECT DomainName, FullName</p> <p>FROM SystemUserBase</p> <p>WHERE (DomainName = @UserID)</p></li> <li><p>Then use</p> <p>=Fields!FullName.Value </p></li> </ol> <p>in your report.</p> <p>In the CRM the user data is stored in the SystemUserBase table, and the DomainName column is the actual <em>Domain\Username</em> stored in User!UserID of the report. If you prefer using views, use <strong>FilteredSystemUser</strong> view instead of <strong>SystemUserBase</strong> table.</p> <p>For fetchxml try the following: The operator <strong><em>operator='eq-userid'</em></strong> means equal to the current user.</p> <pre><code>&lt;fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'&gt; &lt;entity name='team'&gt; &lt;attribute name='name' /&gt; &lt;attribute name='businessunitid' /&gt; &lt;attribute name='teamid' /&gt; &lt;order attribute='name' descending='false' /&gt; &lt;link-entity name='teammembership' from='teamid' to='teamid' visible='false' intersect='true'&gt; &lt;link-entity name='systemuser' from='systemuserid' to='systemuserid' alias='user'&gt; &lt;attribute name='fullname' /&gt; &lt;attribute name='systemuserid'/&gt; &lt;filter type='and'&gt; &lt;condition attribute='systemuserid' operator='eq-userid' /&gt; &lt;/filter&gt; &lt;/link-entity&gt; &lt;/link-entity&gt; &lt;/entity&gt; &lt;/fetch&gt; </code></pre> <p>Then in your report you can use the following code in an expression to get the users fullname </p> <p><strong>=First(Fields!user_fullname.Value, "GetUserData")</strong></p> <p>where the dataset is called <strong><em>GetUserData</em></strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload