Connect activity to custom object

How can I connect the activities to a newly created custom object?

Like 0



Dear Massimiliano,

If you want to add this object in a Connected To tab you would need to add the record into EntityConnection with SysEntitySchemaUId = SysSchema.UId for the SysSchema for Activity and ColumnUId = SysEntitySchemaReference.ColumnId for corresponding object.

If this object is already connected to the Activity you can add the object as a detail.

Best regards,


Thank's Dennis for your answer.

Where can I find an example on how to add the record to the database?

Best regards

Massimiliano Mazzacurati,

Can you please specify which record do you want to add? Do you mean 

the SQL INSERT INTO Statement?

Angela Reyes,

I found the SQL statement but I don't know exactly where to find the ID's involved in the "SQL INSERT INTO" statement

Massimiliano Mazzacurati,

You will need to get UID of your custom object from

SysEntitySchema. Every record has its unique ID so you will need to find it in your DB using SELECT statement from SysSchema. 

Thank's Angela,

OK for my custom object.

I've seen that there are a lot of records in that table about the same standard object (lice Activity, Account and so on): if I want to connect my custom object to activities, which "activity" should I use from the SysEntitySchema table?

Massimiliano Mazzacurati,


You need to choose the desired object and select the record that has the value of the ExtendParent = '0'. Generally, that's the objects from the very basic application packages.

Best regards,


Here is what I did, based on Matt Watts comments:

  1. On the activity section, add a new lookup to the custom entity.  You do not need to add it onto the form itself (because at the end of this it will show in the connected to detail).  Save the activity section.
  2. In the SQL Console (for cloud instances), run this query to get the correct uid for the activity record:
    1. select uid, * from sysschema where name = 'activity' and extendparent=0
  3. Now we need to find the relevant related columnuid in the sysentityschemareference table, for your custom entity and the activity entity.
    1. select * from sysentityschemareference where columnname like '%CustomEntityName%'
    2. You are looking for the columnuid with a createdon of today (if you added the lookup column just now)
    3. Otherwise, run this query to find the right record:
      1. select * from sysschema where id=’sysschemaid’
  4. Once you have that, it is time to insert into the entityconnection table:
    1. insert into entityconnection values (newid(), getdate(), NULL, getdate(), NULL, 0, 'uidfromstep2’, 'columnuidfromstep3', 0)
Show all comments