Offline Filters for CRM 2013 outlook client
Hi Folks,
Hope you are enjoying reading my blog!! I want to add a new post which showcases the offline filters functionality of CRM outlook client.
You know the fact that Microsoft Dynamics CRM supports the offline capability with outlook client. Did you get a chance to look into the offline filters available with CRM outlook client?
Here is a chance to look into them.
- After configuring CRM with outlook client click on File CRM in your outlook client as shown below.
Now click on Go Offline button drop down as shown below:
You can see the different offline filters that are created in your CRM organization.
- Here comes the interesting segment. Do you want to create a custom view through fetch xml? If yes is the answer, try this code snippet to get your things rolling on!!
- First get the service proxy from the CRM organization before using the below code also add "MyOrganizationCrmSdkTypes.cs" available in your CRM sdk for reference.
String fetchXml = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='product'>
<attribute name='name' />
<attribute name='producttypecode' />
<attribute name='productnumber' />
<attribute name='subjectid' />
<attribute name='productid' />
<order attribute='name' descending='false' />
<filter type='and'>
<condition attribute='statecode' operator='eq' value='0' />
<condition attribute='name' operator='eq' value='1234' />
</filter>
</entity>
</fetch>";
SavedQuery filter = new
SavedQuery();
filter.FetchXml = fetchXml;
filter.IsQuickFindQuery = false;
filter.QueryType = SavedQueryQueryType.OfflineFilters;
filter.ReturnedTypeCode = Product.EntityLogicalName;
filter.Name = "Product Sample filter";
filter.Description = "Sample offline filter for Product entity";
_offlineFilter = _serviceProxy.Create(filter);
This can be used to generate dynamic offline filters. You can use this similar stuff in plugins. Ex: If you want to create an offline filter when a new product is launched or created in your organization. You can automate this process.
Hope this helps!!
Cheers,
Vishnu
Comments
- Anonymous
January 05, 2014
Pingback from Offline Filters for CRM 2013 outlook client : Interesting Findings & Knowledge Sharing