Labels

Sunday, December 3, 2017

Dynamics 365 – Alternate keys can stop duplicates

Alternative keys give a method to stop users adding duplicates records, speed up Dynamics 365 searching and are useful for integrating Dynamics 365 with external services/systems.

Alternate keys can stop duplicates
  • Alternate keys can increase record lookup speed
  • Alternative keys allow you to lookup records without a GUID but with information which makes an alternate key.  E.g. lookup a person using surname and email.
  • Work well with upsert, allowing you to find a record and either update or create
  • Can sometimes cause problems when trying to remove them solutions
  • Added in Dynamics CRM 2016 and available in Dynamics 365 online and on premise

An alternate key can be added to an entity and can be made up of one or more fields on the entity.  Alternate keys use database indexes, this has the benefit of making records unique by stopping duplicates and increasing performance when retrieving records with an alternate key.




Alternate key facts
  • Each entity can have 5 alternate keys
  • You can only use strings, decimals and integers (whole number) to create an alternate key
  • There is a maximum key size to be aware of
  • After creating an alternate key, an async job will create the index and the status will be pending, In Progress, Active and failed.  If you have a lot of records this could take a long time.
  • You can retrieve an alternate key using RetrieveEntityKeyRequest, you delete an alternate key using DeleteEntityKeyRequest.

Stopping Duplicates
Alternate keys is they give a way to stop users adding duplicate records.  When you add an alternate key and a user tries to add a duplicate, Dynamics 365 will stop the user from adding the record and show the warning below.



 This is better than out of the box duplicate stopping functionality which only warns the user but lets them add a duplicate.
  

Wednesday, November 22, 2017

CRM Advance Find to get the list of Pending & Failed Emails

The list of Customer and their email address that have been sent email to them, but they still not received any Email yet.
And here is the Advanced Find Query to List all Customer + Email address that in the list of attempted sending Email, but still Failed or Pending.
We have the relationship, so-called Activities Parties that we can use to do query.






You also can use this Advanced Find method to query about Phone Call (Call with whom), Appointment, and another Type, just change the ‘Activity (Email)’ to any Activity Type as required.