You need to sign in to do that
Don't have an account?

Task Object Related To custom object
HI,
The documentation tells me that i can create a task object which is related to an custom object by using the WhatID field. Is i creat a task via DML and link it to my custom object ID the insert will fail because of 'Related To: Opportunity/Account ID: id value of incorrect type: a04A000000Bj8wJIAR'.
Has someone experience with this and is there a way to do this without any custom objects...?
Thanks,
Sten
Check your custom object (Setup > Create > Objects > Edit (Object Name) ) and check the "Allow activities" checkbox. WIthout this box checked, you can't assign a task or event to that type of object.
All Answers
Check your custom object (Setup > Create > Objects > Edit (Object Name) ) and check the "Allow activities" checkbox. WIthout this box checked, you can't assign a task or event to that type of object.
I am running in to this problem for a couple of weeks, can you guys help me out. I have a custom object called CC Card, I want the trigger to execute only if the task is logged under this object and has a certain subject line. If both these conditions meet, I want to update few fields on this custom object. I am very much new to triggers but this is what i have managed to do so far, don't know how to proceed further..
trigger triggerFromTaskToCCCard on Task (after update) {
//Memory allocations for this trigger.
List<Task> TaskRecords = new List<Task>();
Set<Id> setCCCardID = new Set<Id>();
// Combine old and new trigger records into a single list.
if(Trigger.new!=null)
TaskRecords.addAll(Trigger.new);
if(Trigger.old!=null)
TaskRecords.addAll(Trigger.old);
// Collect all Related To (WhatId) values.
for(Task aTask:TaskRecords)
setCCCardID.add(aTask.WhatId);
Any help will be highly appreciated, thanks..
see: psn code generator 2019 (https://heywatchencoding.com/free-psn-codes/)