Tip #44: Reflecting current user in CRM SSRS reports

It is a best practice to reflect the user running the report in an SSRS report and when the report was run in the report footer. This gives you a snapshot of who ran the report, and if there are any questions about the validity of the data reflected in the report, can be very helpful to troubleshoot the issues. Maybe the person running the report doesn’t have security permission to view all the data.

If you read an SSRS book, it will probably tell you to use the built in User!UserID expression in SSRS to reflect the current user. However, when writing reports for CRM, this doesn’t work. The reason is, for CRM reports, all users authenticate to the SSRS server using the same account (the Microsoft Dynamics CRM service account). If you use User!UserID, the report will reflect the name of the CRM service account in the footer.

If you are using SQL based reports, you can get the current user by using the CRM SQL function fn_FindUserGuid. Create a dataset in your RDL with the following query.

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

If you are using Fetch based reports, you can get the current user by using the following FetchXML query.

<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" />
      </filter>
   </entity>
</fetch>

Tip #43: Embed a pre-filtered report in an iFrame

One of the benefits of the Microsoft Dynamics CRM SSRS pre-filtering capabilities is that you can run a report in context of a record, such as an account, so when you run the report, it just shows data related to that record. Reports can also be embedded in forms with iFrames, and prefiltering is very handy to make the embedded report reflect just the record you are viewing on the form.

    1. Add an iframe to your form in which to display the report. In this example I called it “IFRAME_Report.” Set the URL for the iFrame to about:blank and uncheck the “Restrict cross frame script” checkbox.
    2. Run the prefiltered report from the report menu or the form “run report” button. If you see the filter screen, filter the report to the desired record.
    3. After the report runs, copy the URL in your browser. If the URL bar is not displayed, click CTRL+N.
    4. Replace the highlighted lines in the following function to match your report URL. Note–you don’t want the website domain part of the URL–the /crmreports/viewer… URL makes it dynamic, so the report should work in any environment, as well as offline.
    5. Call the showReport function in the OnLoad event.
function showReport()
{
   //Get iframe
   var iframeObject = Xrm.Page.getControl("IFRAME_Report");

   if (iframeObject != null) {
      var strURL = "/crmreports/viewer/viewer.aspx"
         + "?action=run&context=records&helpID="
         + "Name%20of%20Report"
         + ".rdl&id=%7b"
         + "33db4d7f-446e-e311-940f-005056ab530d"
         + "%7d&records="
         + Xrm.Page.data.entity.getId()
         + "&recordstype=1";

      //Set URL of iframe
      iframeObject.setSrc(strURL);
   }
}

Tip #42: Adding Ready-to-use Business Processes

Happy New Year Ladies and Gentlemen – Gus Gonzalez here driving the CRM Tipping Truck today!

One of the biggest additions to Microsoft Dynamics CRM 2013 is Business Process Flow and when you start using Microsoft Dynamics CRM 2013 you will notice that Microsoft has included three new BPF processes for you to understand how this works.

Once you understand how BPF processes work, go ahead and add more Ready-to-Use Business Processes to the mix by Navigating to Settings -> Data Management -> Add Ready-to-Use Business Processes:

tip42-1

A truck load of processes (22 BPF and Workflows) will be automatically added to the list of available processes – some of them will be activated automatically, some of them will not:

tip42-2

I’m still trying to figure out how CRM decides what to activate and what not to activate and when I do I will post a follow up Tip, but until then, Enjoy!

Tip #40: Forty and twelve

It’s been 40 [business] days since our first post. Is it a coincidence that Western Christians have been waiting and preparing for adventus for the exactly forty days ? May be. While Eastern Christians keep the bodies in check throughout 40 days of the Рождественский Пост, we’ve been feeding your minds a steady, healthy and nutritious, even though illegal in some countries, doze of daily tips. Accidental? Perhaps.

A time to scatter tips and a time to gather tips. A time to hi-five and a time to close the shop.

We will re-open our daily injections of CRM wisdom after exactly Twelve Days, on January the 6th, 2014. Happenstance? Don’t think so.

We wish you Happy Holidays and see you (and your friends and colleagues) in the 2014.

Dynamics CRM Tipper
The Custodians of The Tipping Jar, bringing you tips by a truckload

Tip #39: Custom indexes in CRM Online

A little known secret for CRM Online users and a good reminder from . If you’ve added additional search fields to your Quick find or other views, the underlying entity contains a large number of records, and the response time is slow, you might need a custom SQL index added to improve the performance. While administrators of on premises deployments of Dynamics CRM can add SQL indexes as needed, there is no direct access to CRM Online database. The good news is that Microsoft Support can add required database indexes for you. Just open a support ticket and make the request (of course, you’d better do your homework and be sure that the index will solve the issue and not leave database performance unaffected or, worse, slow down your CRM)

Tipped to the jar by

Tip #38: Get Dynamics CRM SDK 6.02

If you’ve been rigorously following our tips, you should have downloaded Update Rollup 1 for CRM 2013 by now. If you are a developer at heart, you’d want latest Microsoft Dynamics CRM SDK as well and, what do you know, version 6.02 has recently been released.

Despite seemingly unimportant version number, this is no ordinary release as it includes cool new Microsoft Dynamics CRM 2013 User Interface Integration package which is available as a separate download.

User Interface Integration (UII) for Microsoft Dynamics CRM uses the features of Dynamics CRM to deliver composite applications that share a common user interface. UII includes development and run-time components. Applications built with UII can provide unified access to customer information spread across different systems, and can aggregate different modes of customer interactions or channels. Unlike expensive, rip and replace approaches or risky investments on custom development, UII provides non-intrusive integration with existing systems.

Tip #37: Update user information in CRM Online (Office 365)

If you use CRM Online on the Office 365 platform, you will notice that the main fields on the user record are read only. This is because user information is managed in Office 365 and synchronizes to CRM.

For example, say you have a CRM environment that already contains active users, and you want to change the format of the full name on the records. Say you want to change it from firstname lastname to lastname, firstname. When you change the format setting in CRM, it only applies to new users. Existing users will keep their existing format for full name.

The answer is to have your Office 365 administrator change something about the user’s name in Office 365. The change will synchronize with CRM, causing the full name format to be updated in the process. Just make sure you wait for a little while–it takes a little bit of time for changes to sync from Office 365 to CRM.

Tip #35: Bring back member management for marketing list

When dynamic marketing list is copied to a static one, the new list appears to be disabled and Manage Members button is nowhere to be found. According to our guest tipster , this is because when Dynamic list is copied to a static one, it is marked ‘locked’ by default. If you set Locked to No and save, you can manage members.