You need to sign in to do that
Don't have an account?
Sourav P
To create a Task counter in Opportunity
Hi ,
I want to create a Task counter in Opp, the counter should increase/count only if the subject is " Opp follow-up" ( not for other subjects), May i know how to do it ?
I was trying PB created on Task object, but couldnt able to put action that increase the " Opp Task Conter " field.
I am trying to write a trigger on Opp, If anyone can suggest , modify my below trigger which is not working to get a proper view, i am new to apex.
Any suggestions plz. Thnx
I want to create a Task counter in Opp, the counter should increase/count only if the subject is " Opp follow-up" ( not for other subjects), May i know how to do it ?
I was trying PB created on Task object, but couldnt able to put action that increase the " Opp Task Conter " field.
I am trying to write a trigger on Opp, If anyone can suggest , modify my below trigger which is not working to get a proper view, i am new to apex.
trigger TaskCount on Opportunity (before insert) { if(newTaskList[0].WhatId != null && ((String)newTaskList[0].WhatId).substring(0,3)=='006') { opp = [SELECT Id,Name,OwnerId,Owner.Email,(SELECT Id FROM Tasks WHERE Status != 'Completed' and Subject='Opportunity follow-up) FROM Opportunity WHERE Id = :newTaskList[0].WhatId LIMIT 1]; } }
Any suggestions plz. Thnx
Try with below code it will help !! Let me know if it helps !!
Thanks
Manoj
All Answers
Better you can write a trigger in task with event after insert and after delete with condition task.WhatId != null && String.valueOf(task.WhatId).startsWith('006') && task.subject='Opportunity follow-up'
then collect all opportunity id and do a query and update accordingly to opportunity.
Let me know if u r facing problem .
Thanks
Manoj
Try with below code it will help !! Let me know if it helps !!
Thanks
Manoj
Just a small issue. I want to take this field value to that of Task object. So, I created just a formula field in Task, having the below, But i dont understand why its not working, Can you plz suggest,
You can not create formula like this as task and opportunity is related through WhatId not Opportunity __c .
You can close this thread so that if any one else have same probelm they can use the code .
Let me know incase any
Thanks
Manoj
Can you plz suggest a way to bring the field in Task page.