Re: Getting Object type of WhatId/Who Id Task/Event fields
08-29-2011 04:17 PM
oh thanks, i ended up doing what another user posted and it worked!
if(ta.WhatId != null){
String account_prefix = Schema.SObjectType.Account.getKeyPrefix();
String task_whatid = ta.WhatId;
System.debug('who: ' + ta.WhoId + ' what: ' + ta.WhatId + ' prefix: ' + account_prefix + ' eval: ' + task_whatid.startsWith(account_prefix) + ' id: ' + ta.id );
if(task_whatid.startsWith(account_prefix)){
