How can I connect the activities to a newly created custom object?
Like
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. https://academy.bpmonline.com/documents/technic-sdk/7-13/adding-details
Best regards,
Dennis
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,
Hello,
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,
matt
Here is what I did, based on Matt Watts comments:
- 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.
- In the SQL Console (for cloud instances), run this query to get the correct uid for the activity record:
- select uid, * from sysschema where name = 'activity' and extendparent=0
- Now we need to find the relevant related columnuid in the sysentityschemareference table, for your custom entity and the activity entity.
- select * from sysentityschemareference where columnname like '%CustomEntityName%'
- You are looking for the columnuid with a createdon of today (if you added the lookup column just now)
- Otherwise, run this query to find the right record:
- select * from sysschema where id=’sysschemaid’
- Once you have that, it is time to insert into the entityconnection table:
- insert into entityconnection values (newid(), getdate(), NULL, getdate(), NULL, 0, 'uidfromstep2’, 'columnuidfromstep3', 0)