In this webinar, our experts showcase a variety of demo use cases of how different components of the...
Before we get to the CRM 2011 remove notes, connections, etc. functionality, let's keep in mind a fine print warning.
All is well as long as you heed the warning, but as it so often happen, we tend to conveniently forget until long after we have developed a bunch of attributes, relationships, forms, JavaScripts, workflows and even plugins and then it hits us – we really do not need connections, notes & attachments or activities for that entity! Then why were they enabled in the first place, because Connections, Notes & Attachments and Activities are checked by default.
Now that we have done that cannot be undone, we come to the topic of this blog. How to in CRM 2011 remove Notes & Attachments, Connections and Activities from an Entity, well without doing the obvious – drop the entity and recreate it.
A couple of notes of caution before we dive into the How To's
Perquisites:
How to:
To Remove Connections
Make the following XML Tags changes in the Customizations XML |
Entities > Entity - Select the Entity you need > EntityInfo > |
Modify <IsConnectionsEnabled>1IsConnectionsEnabled> |
Set the Value from 1 to 0 |
EntityRelationships |
Delete <EntityRelationship Name="EntityName_connections1"> node |
Delete <EntityRelationship Name="EntityName_connections2"> node |
Replace the Entity Name above and remove the entire node |
To Remove Notes and Attachments
Make the following XML Tags changes in the Customizations XML |
Entities > Entity - Select the Entity you need > EntityInfo > |
Delete <HasRelatedNotes>TrueHasRelatedNotes> node |
Entities > Entity - Select the Entity you need > FormXML > forms type = "main" > systemform > form > tabs > tab > labels > label > Description = "Notes" |
Delete Entities > Entity - Select the Entity you need > FormXML > forms type = "main" > systemform > form > tabs > tab |
This can also be done after importing the solution - Open the Entity for customization > Goto the Form and Delete the Notes Tab |
EntityRelationships |
Delete <EntityRelationship Name="EntityName_Annotations"> node |
Replace the Entity Name and remove the entire node |
To Remove Activities
Make the following XML Tags changes in the Customizations XML |
Entities > Entity - Select the Entity you need > EntityInfo > |
Delete <EntityMask>ActivityPointerEntityMask> node |
Delete <HasRelatedActivities>TrueHasRelatedActivities> node |
EntityRelationships |
Delete <EntityRelationship Name="EntityName_ActivityPointers"> node |
Delete <EntityRelationship Name="EntityName_Appointments"> node |
Delete <EntityRelationship Name="EntityName_Emails"> node |
Delete <EntityRelationship Name="EntityName_Faxes"> node |
Delete <EntityRelationship Name="EntityName_Letters"> node |
Delete <EntityRelationship Name="EntityName_PhoneCalls"> node |
Delete <EntityRelationship Name="EntityName_RecurringAppointmentMasters"> node |
Delete <EntityRelationship Name="EntityName_ServiceAppointments"> node |
Delete <EntityRelationship Name="EntityName_Tasks"> node |
Replace the Entity Name |
This also needs to be done for any custom activities that you may have created - Replace the Entity Name and the Custom Activity Name |
Delete <EntityRelationship Name="EntityName_CustomActivities"> |
Campaign Response is the only exception - but this is associated with only Account, Contacts and Leads.
Hope this helps. Check our Microsoft Dynamics CRM Expert blog often for helpful tips and tricks.
Happy CRM'ing!
Once I recreate the entity in the donor ORG, can I export the entity and reimport into the original environment? For example,
I export from DEV,
import into DEVdonor without activity,
then I export from DEVdonor can I reimport into DEV?
Hi Kurt - yes, you should be able to create a new solution, add just this one entity, and export as an unmanaged solution. Then import into the other org.
I followed the procedure explained but it didn't worked... not sure where I am going wrong...
I need to update the entity form xml using javascript. For that I am using the xmldom method. I goggled lot but nowhere found appropriate solution.
Please let me know is there any way to update entity form xml using javascript.
Any help will highly appreciated.
Thanks!
Do you know if the same thing will work with CRM2013?
Hi,
Is there any solution to disable it on the same environment? as I want to disable it from our production environment and I don't want to delete the entity?
Thanksm
If you are a bit more daring, I have done this a lot faster with a (relatively) simple SQL script. I used the SQL profiler to examine the SQL commands CRM issued to the database when switch ON activities for a custom entity, and then reverse-engineered them to come up with my script, and, as far as I can tell so far, it worked perfectly. I haven't had to do Notes and Connections yet... Those might require an update to the MetadataSchema.Entity record... not sure, but they should be pretty simple and similar.
Obviously this only works for those with on-premise installs (i,.e. not hand-cuffed by a cloud implementation!), and is for CRM 2011. I take no responsibility for your system getting all messed up, but... it worked for me. You should have no activities associated with the entity you are try to de-activate.
...hope someone finds it helpful.
I really wish there were more "unsupported" easy fixes like this floating around the 'net.
Cheers,
Chris
declare @tablename varchar(100)
SET @tablename = 'new_testentity'
declare @entityrel table (id uniqueidentifier)
declare @rel table (id uniqueidentifier)
INSERT INTO @entityrel
SELECT EntityRelationshipId
FROM [EntityRelationship]
WHERE
SCHEMANAME IN ( @tablename + '_activitypointers'
, @tablename + '_appointments'
, @tablename + '_emails'
, @tablename + '_faxes'
, @tablename + '_letters'
, @tablename + '_phonecalls'
, @tablename + '_tasks'
, @tablename + '_serviceappointments'
, @tablename + '_recurringappointmentmasters'
)
INSERT INTO @rel
SELECT RelationshipId
FROM Relationship
WHERE
NAME IN ( @tablename + '_activitypointers'
, @tablename + '_appointments'
, @tablename + '_emails'
, @tablename + '_faxes'
, @tablename + '_letters'
, @tablename + '_phonecalls'
, @tablename + '_tasks'
, @tablename + '_serviceappointments'
, @tablename + '_recurringappointmentmasters'
)
delete from RelationshipExtraCondition
WHERE RelationshipId in (select ID from @rel)
delete from EntityRelationshipRelationships
WHERE EntityRelationshipId in (select ID from @entityrel)
delete from EntityRelationshipRelationships
WHERE RelationshipId in (select ID from @rel)
delete from [Relationship]
WHERE RelationshipId in (select ID from @rel)
delete from [RelationshipIds]
WHERE RelationshipId in (select ID from @rel)
delete from EntityRelationshipRole
WHERE EntityRelationshipId in (select ID from @entityrel)
delete from EntityRelationship
WHERE EntityRelationshipId in (select ID from @entityrel)
delete from [EntityRelationshipIds]
WHERE EntityRelationshipId in (select ID from @entityrel)