Showing posts with label CRM 2013 tips. Show all posts
Showing posts with label CRM 2013 tips. Show all posts

Tuesday, November 10, 2015

CRM 2013 Tips: Set field read only/lock after save the record using CRM Business Rules

There are various ways to set field read only after saving record in CRM, most popular way is use JavaScript. However we can use Business Rule to set field read only based on the behavior of the other field or value of the same field. But there were no direct way to set field read only after saving the record. However we can utilize some behaviors of the Business Rule to set field read only after saving.

We can use “set field read only based on another field value” feature to set target field to read only. To do that we need a field which set value automatically after save the record and it should be read only by default. In CRM we have 4 fields which have those properties. Those fields are “Created By”, “Created On”, “Modified By” and “Modified On”. To set field read only after saving we need to add one of these fields to your target form (because Business Rules are working on the fields which available in the form). Then we can create business rule to set read only relevant field based on the value of previously mentioned fields.


For example:
I need to set read only field called “Identification Number” in the contact form after saving contact details.

Steps:
Add one of following fields in to the contact creation form.
  •     Crated On
  •     Created By
  •     Modified On
  •     Modified By

We choose “Created By” field as helping field to create business rule




Then create business rule to set “Identification Number” field to read only after set value to the “Crated By” field. We set business rule scope to form which we need to create contacts.



After activate business rule just create a contact record then you can see the Identification Number get locked because Created By field contains the data





Wednesday, July 8, 2015

CRM Tips: Fixing The Import Organization Wizard cannot connect to the SQL server or cannot find an organization database



Sometime Microsoft Dynamic CRM organization import wizard will end up with following error

The Import Organization Wizard cannot connect to the SQL server or cannot find an organization database on <SQL Server>.






This error can occur when you importing CRM organization from SQL server which contains any other databases (other than CRM organization database).

To fix this issue need to perform following activities and checks

  1. Check SQL connectivity
  2. Check restore database name has “_MSCRM” phrase. If not then rename database before importing.


If previous checks are fine then connect to the SQL server and temporary set offline the database which mentioned in the organization import.







If database take long time to go offline then close the deployment manager and try again previous step

Note: CRM deployment manager establish multiple connections with the database and SQL server unable to close these connections. Use following query to check existing processes which establish connections with the database



Select *

From sys.sysprocesses

Where dbid = db_id(‘dwstaging’)






After database goes offline then import relevant organization.