How to customise statuscode attribute of appointment entity

How to customise statuscode attribute of appointment entity

In this post i am going to explain how you can customise statuscode attribute of appointment entity in CRM Dynamics 2011. By default appointment entity has following statecode and statuscode values.

 

Entity Status (statecode) Associated Status Reason   (statuscode)

Appointment   (appointment)

0 Open 1 Free
2 Tentative
1 Completed 3 Completed
2 Canceled 4 Canceled
3 Scheduled 5 Busy
6 Out of Office

If you try to customise appointment entity and try to add new values to statuscode field, CRM will not allow to change becaue this field is locked by CRM 2011.

How to customise statuscode attribute of appointment entity
Customise Status code Field.

 

You can unlock this field by using unsuported method, which is update lock field against this entity in SQL Server Database.

 

Step 1:  Get entity id of appointment field. Remember to run all these queries against MSCRM database

SELECT Entityid FROM Entity

WHERE logicalname IN (‘appointment’)

orderby LogicalName asc

 

Step 2: Check locked field’s value againist entity id in MetadataSchema.Attribue. If locked field value is 1 that’s mean it is locked and if it’s values is 0 that’s mean it is unlocked.

select  * from MetadataSchema.Attribute

where EntityId=’95E930C5-812A-44E8-85C9-154CD5F59465′

AND LogicalName = ‘statuscode’

 

Step 3. Update  MetadataSchema.Attribute table and Set locked field’s value to 0.

UPDATE  MetadataSchema.Attribute SET Locked = 0

WHERE EntityId

IN (SELECT Entityid FROM Entity WHERE logicalnameIN (‘appointment’))

AND LogicalName = ‘statuscode’

Now you will be able to add new statuscode for appointment entity. As you can seen in below screen shot all button are enabled now.

How to customise statuscode attribute of appointment entity
status of the appointment.

 

If you like this post please click LIKE and visit my sponsors thanks !!!

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *