How to – Use Update to change the status and update owner (instead of SetState and Assign Request) in CRM 2015/2016


Prior to CRM 2015 Update 1, if we had to change the owner or set the state of the record we had to use Assign and SetState Request.

Now we can use our Update request for the same.

For e.g. we have below Active record owned by user named Nishant Rana.

Using below Update Request we can change the owner as well as set the record as inactive in a single request.

</p>
<p>Entity demoEntity = new Entity("new_demoentity");</p>
<p>// here we are using alternate key to update the record instead of Guid<br />
demoEntity.KeyAttributes.Add("new_alternatekeyfield", "My Alternate Key 2");</p>
<p>demoEntity.Attributes["new_name"] = "Updated record at " + DateTime.Now.ToShortTimeString();</p>
<p>// update owner id<br />
demoEntity.Attributes["ownerid"] = new EntityReference("systemuser", new Guid("16406B31-5E97-E611-80E3-FC15B42877A8"));</p>
<p>// set record as inactive<br />
demoEntity.Attributes["statecode"] = new OptionSetValue(1);</p>
<p>organizationProxy.Update(demoEntity);</p>
<p>

 

Point to remember is that if we have plugin registered either PRE or POST on Update and Assign both will be triggered.

Hope it helps..

Advertisements

Sample Code to use UpsertRequest in CRM 2015\2016


UpsertRequest was a new request introduced in CRM 2015 Online Update 1.

The request based on the alternate key specified, looks for the record, if the record is existing it updates it else it creates a new record.

https://nishantrana.wordpress.com/2016/10/25/alternate-keys-in-crm-2015crm-2016/

UpsertResponse has a property named RecordCreated which is false if the record is found and updated else it is true if record is created. The Target property holds the reference of the record created or updated.

Suppose we have following record created. It has Alternate key defined on “Alternate Key Field”

Sample Code

As we have demo entity record with alternate key field having value as “My Alternate Key 1” it will update the record.

Running it again this time changing the value for the alternate key field.

It creates a new record.

Hope it helps..

Using PluginTypeStatistic records to monitor plugins \ custom workflow activities hosted in sandbox in CRM 2016 (and earlier)


CRM collects runtime information about the plugins and custom workflow activities executing in sandbox mode in PluginTypeStatistic records every hour or so.

Go to Advanced Find View and select – Plug-in Type Statistics

It gives us details regarding “The average execution time”, “Execution Count”, “Failure Count” etc. for each of the plugins and custom workflow activities.

Hope it helps.

“Create Dynamics Leads based on Tweets” using Microsoft Flow in CRM 2016


Microsoft Flow is a workflow management tool, using which we can create automated workflows between various services and apps.

With Dynamics CRM Online common scenarios could be

  • Create Dynamics CRM Leads from an Excel table.
  • When an opportunity is created post to Yammer.
  • Copy new Dynamic CRM Account to Common Data Model etc.

https://flow.microsoft.com/en-us/

https://flow.microsoft.com/en-us/services/shared_dynamicscrmonline/dynamics-crm-online/

  • Below are some of the templates available for CRM Online

  • Let us take a Template that creates Leads based on Tweets

  • Connect to both the services

  • Configure it, for e.g. search for #msdyn365, get the Tweeter User Name and create the lead record. Map topic in lead with tweet text.

  • Check the status of the flow.

  • Leads created in CRM

Hope it helps..

Passing EnumType parameter in Web API in CRM 2016


Recently we were calling InitializeForm function through WEB API, to which parameters to be passed were

TragetFieldType EnumType values:-

URL

https://xxx.crm.dynamics.com/api/data/v8.1/InitializeFrom(EntityMoniker=@p1,TargetEntityName=@p2,TargetFieldType=@p3)?@p1={‘@odata.id’:’accounts(AAA19CDD-88DF-E311-B8E5-6C3BE5A8B200)’}&@p2=’account’&@p3=Microsoft.Dynamics.CRM.TargetFieldType’All’

The Parameters


Please refer the below link to get a good understanding on Web API

https://debajmecrm.com/?s=web+api

Hope it helps..


Notes on MB2-710 Microsoft Dynamics CRM 2016 Online Deployment Certification Exam


Today i took MB2-710 CRM 2016 Exam. Below are my notes that helped me in clearing the exam.

  • Web Browser requirements:
Internet Explorer 10, 11
Mozilla Firefox, Google Chrome, Safari Latest Version
  • CRM for Outlook 2016 requirements:
Windows 7 with SP1, 8, 8.1 and 10, Server 2012, 2012 R2 Remote Desktop Services.
Office 2010, 2013, 2016
Internet Explorer 10, 11
  • Phone requirements:
iOS 7, 8, 9
Android 4.4, 5
Windows Phone 8.1, 10
  • CRM for Tablet:
Windows 8.1, 10
iOS 6,7, 8, 9
Android 4.2, 4.3, 4.4, 5.0
  • User Subscription License types
Employee Self Service
Essential
Basic
Professional
Enterprise
  • Different Office 365 Admin roles.

https://support.office.com/en-us/article/About-Office-365-admin-roles-da585eea-f576-4f55-a1e0-87090b6aaa9d

  • One production instance is included at no cost with minimum of 25 Professional Licenses.
  • 5 GB of storage for all subscriptions.
  • No option of backup and restore of CRM on premise to CRM Online.
  • Data Loader Service – cloud based service to move data from files to CRM Online.
  • Office 365 is not required to purchase CRM Online.
  • During cancellation of subscription, cancellation fees might be charged and data will be deleted after 30 day. We can contact technical support to arrange for the backup.
  • Call support and provide billing administrator user name and password and other details for cancellation.
  • To disable a user in Online, simply remove the license of the user.
  • “Non-Interactive” user can be created for Programmatic access to CRM, the user doesn’t consume a license and for each instance 5 non-interactive users can be created.
  • We can synchronize Active Directory with Office 365 or can use ADFS for account administration.
  • Different Administrative roles à Billing Admin, Global Admin (System Administrator in CRM), Password Admin, Service Admin (System Administrator in CRM), User Management Admin.
  • Instances action à Switch, Reset, Delete, Copy.
  • Production instance cannot be Reset.
  • Sandbox instance can be put in Administration Mode and System Administrator and System Customizer role can sign in to the instance.
  • Full copy copies with Data and Minimal copy includes users and customizations only.
  • A tenant can have 50 Production and 75 non-production instance.
  • A tenant can only be federated with only one on premise AD and licenses and subscriptions are not shared among tenants.
  • Notifications are sent to administrators or any additional recipients configured when 80 % for storage limit is reached. If storage limit is reached no new records can be created. Here then data needs to be removed and\ or additional storage needs to be purchased.
  • New features\updates are delivered for CRM Online twice a year and needs approval from Customer.
  • Updates are approved/rescheduled at instance level.
  • OneNote notebooks are stored in SharePoint site so server based integration must be enabled and also at Entity Level Document Management and One Note integration should be enabled.
  • Skype integration includes both Skype and Skype for Business.
  • Office 365 Groups are for collaboration purpose between CRM Users and non-CRM Users.
  • OneDrive for business allows 1TB of storage space. Security role “One Drive for Business”.
  • CRM for Outlook for tracking email, appointments, contacts and tasks.
  • CRM 2015 for Outlook will work with CRM 2016 but only in Online Mode.
  • Only one organization can be used for synchronization, for non-synchronizing organization offline is not supported.
  • Fields that needs to be synchronized can be configured now. Works with outlook and server side synchronization but not with Email Router.
  • Existing record cannot be deleted or linked. New records can be created as drafts while working with CRM for tablets and phone app.
  • Privilege – “CRM for mobile” for CRM for tablets and phones and “CRM for phone express” for CRM for phone express.
  • Entities can be made read only for CRM for tablets and phones. All custom entities can be enabled for mobile apps.
  • Tabs, Section and fields can be hidden for CRM for Phone not for Tablet.
  • Multiple User and System dashboard can be enabled.
  • Server Side – Email router or server side synchronization and client side – Outlook Client can be used for Email Processing.
  • Email router cannot synchronize App, Contacts, Tasks created in CRM Outlook client.
  • Server side synchronization can be managed through web, provides error reporting and sync appointment, contacts and task.
  • Folder Level Tracking needs server side synchronization and folders to be under inbox. 25 folders per user account can be used for folder level tracing.
  • Emails are removed from the Forward mail box after processing unlike individual mail box monitoring.
  • Email address change to a user or queue needs to be approved. It can be disabled separately.

Please refer these articles for preparation

https://neilparkhurst.com/category/crm/crm-certifications/mb2-710-crm-2016-online-deployment/

Hope it helps..