Server Side Sync: View for Synced and Not-Synced Appointments

If you decide not to use the CRM App for Outlook, syncing emails, contacts and appointments using just Server Side Sync and Forward Mailbox can be really painful sometimes, especially when you are troubleshooting why something is not being synced. The “Server-Side Synchronization Monitoring” Dashboard provides some assistance to the Administrator, but when you want to dig into the details, I often end up using “FetchXML Builder” or “LinqPad” to query the TraceLog entity. Below is the fetchxml I use

<fetch top="50" >
  <entity name="tracelog" >
    <attribute name="tracestatus" />
    <attribute name="tracedetailxml" />
    <attribute name="tracelogid" />
    <attribute name="machinename" />
    <attribute name="tracecode" />
    <attribute name="traceactionxml" />
    <attribute name="traceparameterxml" />
    <attribute name="traceparameterhash" />
    <attribute name="errortypedisplay" />
    <attribute name="modifiedon" />
    <attribute name="text" />
    <attribute name="level" />
    <attribute name="collationlevel" />
    <filter>
      <condition attribute="tracestatus" operator="eq" value="0" />
    </filter>
    <order attribute="createdon" descending="true" />
  </entity>
</fetch>

Another common scenario that I troubleshoot is, why an appointment is not synced to Outlook after it was created in CRM. The first thing to check in this case is the user’s sync filter. I use the XrmToolBox tool “Sync Filter Manager” to check what the user’s sync filter for appointment. After confirming that the fetchxml picks up the appointment that has to be synced, we can now proceed to stage 2 of troubleshooting.

The field that is key in this scenario is called “GlobalObjectId“. This field in the appointment entity will be set, after the appointment is synced to the user’s Outlook. Unfortunately, this field is marked as not searcheable, which means it cannot be used in Advanced Find.

Global ObjectId.png

But, we can still create view that shows the synced appointments and appointments that have not been synced, using FetchXML Builder. Below are the steps

  1. Install FetchXML Builder from XrmToolBox store, if you don’t have it already
  2. Save an existing view into a new view on appointment entity. Don’t worry about the filters yet as we will update this using FetchXML BuilderSave a new view.png
  3. Next step is to open this view in FetchXML BuilderOpen View.png
  4. Update the fetchxml and save the view. Confirm the user’s sync filter for appointment using the Sync Filter Manager and make sure the new fetchxml criteria match with the user’s sync filter criteriaSave View.png

Synced Appointments – FetchXML

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" >
  <entity name="appointment" >
    <attribute name="subject" />
    <attribute name="scheduledstart" />
    <attribute name="scheduledend" />
    <attribute name="regardingobjectid" />
    <attribute name="prioritycode" />
    <attribute name="activityid" />
    <attribute name="instancetypecode" />
    <attribute name="location" />
    <order attribute="createdon" descending="true" />
    <filter type="and" >
      <condition attribute="scheduledstart" operator="not-null" />
      <condition attribute="instancetypecode" operator="neq" value="2" />
      <condition attribute="scheduledend" operator="not-null" />
      <condition attribute="globalobjectid" operator="not-null" />
    </filter>
    	<link-entity name="activityparty" from="activityid" to="activityid" alias="ad" >
      <filter type="and" >
        <condition attribute="participationtypemask" operator="ne" value="9" />
      </filter>
    </link-entity>
  </entity>
</fetch>

Not Synced Appointments – FetchXML

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" >
  <entity name="appointment" >
    <attribute name="subject" />
    <attribute name="scheduledstart" />
    <attribute name="scheduledend" />
    <attribute name="regardingobjectid" />
    <attribute name="prioritycode" />
    <attribute name="activityid" />
    <attribute name="instancetypecode" />
    <attribute name="location" />
    <order attribute="createdon" descending="true" />
    <filter type="and" >
      <condition attribute="scheduledstart" operator="not-null" />
      <condition attribute="instancetypecode" operator="neq" value="2" />
      <condition attribute="scheduledend" operator="not-null" />
      <condition attribute="globalobjectid" operator="null" />
    </filter>
    	<link-entity name="activityparty" from="activityid" to="activityid" alias="ac" >
      <filter type="and" >
        <condition attribute="participationtypemask" operator="ne" value="9" />
      </filter>
    </link-entity>
  </entity>
</fetch>

You should now be able to use these new view from the grid area.

Synced Appointments.png

If you try to use the view from Advanced Find, you will get this error.Advanced Find.png

This means you have to use FetchXML Builder to update you fetchxml, if any changes are required in the future. If you want to add more columns to the view, you’ll have to use “View Designer” to do that, as you would not be able to use Advanced Find to do this, because of this error.

I hope this post will help you troubleshoot future appointment sync issues.

Tools used:

  1. LinqPad
  2. Dynamics CRM LinqPad Driver
  3. XrmToolBox
  4. FetchXML Builder
  5. View Designer
  6. Sync Filter Manager
Advertisements

XrmToolBox Tool: Entity Image Updater

Around middle of last week, I published v1.0 of a new XrmToolBox tool called Entity Image updater. I created this tool so that it is easier to update the images on the crm record, if that entity has an image field.

When an entity has an image field and no image has been uploaded, it displays the default person image next to the primary name label.

BeforeImage

You can upload an image, by clicking the person image and choosing a local file.

UploadImageOnce the image is upload, the form looks much nicer IMHO.

AfterImageEven though this capability exists, not many people seem to use this because:

  1. You need source the images
  2. Manually upload them one by one OR write code to upload them based on some conditions

There are so many APIs available to retrieve this data. The most useful of these APIs for this task are

  1. Clearbit – Retrieve logo based on an organisation URL
  2. Twitter – Retrieve logo based on a Twitter handle
  3. Gravatar – Retrieve logo based on a person’s email. This works only if this person has a Gravatar profile

We can try to first source the logo/avatar from these APIs, and we fail to retrieve we can still fallback to uploading an image that is relevant. This is where I believe this tool will be useful. Here is how it looks after the tool has updated the entity images.

Entity Image Updater ScreenshotThe tool actually updates a field called “entityimage” in the entity.

EntityImageField

Installation

  1. Download the latest version of XrmToolBox.
  2. Install the tool from the XrmToolBox store. Refer http://mscrmtools.blogspot.com.au/2016/04/welcome-to-xrmtoolbox-plugins-store.html for additional details.

Using the Tool

  1. After opening the tool, click “Load Entities” to display all entities
  2. Choose an entity that has an entity image field. You’ll know that an entity has this field, if it has the person default image on the form. This is important, as I currently don’t check if the entity has this field or not. I plan to do this in the next version.
  3. Choose a source for the images. If you chose “Local Folder” you will be asked to select the folder that has the images. Please ensure that the folder has the right sized images. I plan to add resize, upload capability in the future version for “Local Folder” option
  4. Choose an attribute whose value you would use to search. For eg. if you choose “Clearbit”, select a field that has the company’s Url. This could be the file name, if you chose “Local Folder” (only png, jpg and jpeg images can be used, if you chose this option)
  5. Click on “Update All“, if you would like to lookup and update all the records for this entity
  6. If you would like to specify a criteria for update, then click the “Selective Update” field. For eg. you might want to only update records that were created by you. This will open FetchXML Builder that will help you build the conditions. Currently there is a 5-10 second delay in opening the FXB tab. I am still investigating the reason for this delay and will update the tool, once I figure out the fix. The tool will start the update process, straight after you click “Return FetchXML” in the FetchXML Builder tool

The tool will display all the images that were updated in the results window. I haven’t added the capability to save these images to disk, but I will add it in the future if that is a useful feature. I hope this tool will help all CRM folks to fully utilise the entity image field. Please feel free to use the Entity Image Uploader Issues area to log any issues that you encounter.

Thank you to

  • Guido and Adam for their feedback and suggestions
  • Tanguy for XrmToolBox
  • Daryl aka DLaB for the XrmToolBox improvements
  • Jonas for FetchXml Builder

Source code for this tool can be found at https://github.com/rajyraman/Ryr.XrmToolBox.EntityImageUpdater

New XrmToolBox Plugin: Export to Excel

Export to Excel is a great feature in Dynamics CRM, but it has always come with two limitations

  1. Number of records that can be exported
  2. Format of the Excel file

Even though CRM says that it is exporting to Excel, what it is exporting to, is not xlsx format. This limitation has been addressed in CRM2015 Update 1. The number of records, you can export, has also been increased to 100,000. But if you still want to export the whole dataset, the easiest way I found, is to export it from the filterview in the MSCRM database. This is obviously not possible, if you are using CRM Online. Hence, I developed this tool, to do just that.

Installation

  1. Download the latest version of XrmToolBox.
  2. Install the tool from the XrmToolBox store. Refer http://mscrmtools.blogspot.com.au/2016/04/welcome-to-xrmtoolbox-plugins-store.html for additional details.

 

Export to Excel Tool
Export to Excel Tool

Using the Tool

  1. Open Export to Excel tool in XrmToolBox
  2. Click on Load Entities. Select an entity you would like to export
  3. The “Batch size” field dictates the default page size. This is initially set to 5,000 records per page
  4. The “Max rows per file” field dictates the maximum number of row per Excel file. This is used to split the excel file. For e.g. if you view/fetchxml produces 500,000 records and you set the “Max rows per file” value to 100,000, your result will be exported to 5 Excel files.
  5. Click on any view that you would like to export. The view’s fetchxml is also displayed
  6. Click Export to Excel. Enter the filename that you would like to save this tool, or leave it to the default value

The tool displays the progress of the file export, while retrieving records from CRM. The total number of records retrieved is also displayed, upon successfully writing the data to the output file. Credits This tool uses code from Tanguy’s View Layout Replicator, for most of the UI and event handling logic.

Source code for this tool can be found at https://github.com/rajyraman/mscrmexporttoexcel

Update Tooltip using XrmToolBox Easy Translator

XrmToolBox is one of my favorite tools, that I use everyday. Among the 20+ tools in XrmToolbox, these are my top three by  usage
1.) Sitemap Editor
2.) Web Resources Manager
3.) View Layout Replicator

Among all these tools, which are all exceptional, Easy Translator is one I never used, as I work only on CRM Deployments with English as the primary language and no requirement from any of the users for alternate languages. There is a interesting usecase for this tool, apart from translation. You can use this to update the tooltip text is CRM 2013. Tooltip text in CRM 2013 is picked up from the description on the field property.

The account name field will show the tooltip text as “Type the company┬áname or business name” when the user hovers over the label.
If we want to setup meaningful tooltips for lot of fields, it is easier to do this via Easy Translator. First export the selected entity to Excel using Easy Translator. I this case I have just chosen Account. We just want to export only the Attributes.
Next open the file in Excel and update Description for the attributes that require a different tooltip text, I this case I am going to change the tooltip text only for the Account Name field to “Type the organisation name or business name“.
Save the Excel file and import it.
The tooltip text should now reflect your changes.