You need to sign in to do that
Don't have an account?
Incompatible element type Datetime for collection of Lead(Error)
Hi,
Need Help!!
trigger Update_modified_date on Task (after insert,after update) {
list<task> t=[SELECT LastModifiedDate FROM Task];
list<lead> l=[select TaskLastModifiedDate__c from lead where Isconverted = false];
for(task t1:t){
//system.debug('this is ----------------------------------');
for(lead l1:l){
system.debug('this is ----------------------------------');
l1.TaskLastModifiedDate__c=t1.LastModifiedDate;
l.add(l1.TaskLastModifiedDate__c);
}
}
update l;
}
Iam trying to copy last modified date of task in lead.But iam getting the following error.Please help.
Error: Incompatible element type Datetime for collection of Lead
Need Help!!
trigger Update_modified_date on Task (after insert,after update) {
list<task> t=[SELECT LastModifiedDate FROM Task];
list<lead> l=[select TaskLastModifiedDate__c from lead where Isconverted = false];
for(task t1:t){
//system.debug('this is ----------------------------------');
for(lead l1:l){
system.debug('this is ----------------------------------');
l1.TaskLastModifiedDate__c=t1.LastModifiedDate;
l.add(l1.TaskLastModifiedDate__c);
}
}
update l;
}
Iam trying to copy last modified date of task in lead.But iam getting the following error.Please help.
Error: Incompatible element type Datetime for collection of Lead
Can you please explain me the requirement.
The way you are using trigger is wrong. You are using ofr insider for which is not a best practice.
Do you want to update task last LastModifiedDate in its parent lead?
let me know if you are facing any problem.
have you got solution for your problem?
Startswith method signature is incorrect.It says the method doesnot exists.
FYI, This will not create new lead. It is a way to update lead.
Task.WhoId is having lead Id so, we are making Lead.Id = Task.WhoId
then if you see line number 14 we are just updating the lead.
If you want more information, p[lease pass me your contact information like skype/email so that I can explain you.
Thanks,
Veda
Please pass me your contact information like skype/email here.