Thursday, 19 March 2015

Show logged in or current Username in Report CRM 2011, 2013 and 2015

It is always good to show to user name who is running the report on it.

We can achieve it by creating one more dataset exclusively for getting username from CRM. You use this dataset to display fullname in the report.

SQL Report

select fullname
from FilteredSystemUser
where systemuserid = dbo.fn_FindUserGuid()

Fetch XML Report

<fetch version="1.0" output-format="xml-platform"

       mapping="logical" distinct="false">

   <entity name="systemuser">

      <attribute name="fullname" />
      <attribute name="systemuserid" />
      <order attribute="fullname" descending="false" />
      <filter type="and">
         <condition attribute="systemuserid"
                    operator="eq-userid" />

Happy CRM'img

No comments:

Post a Comment