function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Joseph BauerJoseph Bauer 

Custom Lookup on Activity Not Found in Apex

I have the beta version of the ability to create custom lookup fields on activities enabled. So when I create a look up field to Account I would expect to see 3 relationships to account from a task: AccountID, WhatId, and the newly created lookup field we'll call it Account__c. When I execute this code snippet in execute anonymous it doesn't display the custom lookup field.

Schema.DescribeSObjectResult describe = Account.sObjectType.getDescribe();
Schema.sObjectType childSObject;

for (Schema.ChildRelationship child : describe.getChildRelationships())
{
     childSObject = child.getChildSObject();
     system.debug(childSObject);
     system.debug(child);
}
 

It lists all the relationships except the custom one that was created on task. Is this a known issue?

Best Answer chosen by Joseph Bauer
Neetu_BansalNeetu_Bansal
Hi Joe,

It would not be listed under task or event as the source object but rather listed under LookedUpFromActivity. Please check accordingly.

Thanks,
Neetu

All Answers

Neetu_BansalNeetu_Bansal
Hi Joseph,

Go through this link:
http://releasenotes.docs.salesforce.com/en-us/winter15/release-notes/rn_sales_activities_activity_custom_lookups.htm

This specofy what are the limitations of custom look ups on Activity. For resolve the issue, I need to analyze in your salesforce org. So if possible you can share your login credentials with me.

Thanks,
Neetu
Joseph BauerJoseph Bauer
Hi Neetu,

I'd rather not give out my login credentials. Can we do a screen share instead? 

Regards,
Joe
Neetu_BansalNeetu_Bansal
Hi Joe,

It would not be listed under task or event as the source object but rather listed under LookedUpFromActivity. Please check accordingly.

Thanks,
Neetu
This was selected as the best answer