You need to sign in to do that
Don't have an account?
Srini
How to create a task when opportuinty field is updated ?
Hi Team,
We have one Requirement Hear we have some fields in the opportunity those are Status,Help,Description. Here we want to entering some details in the Description field for that time automatically Task should be create with Subject name TestDescription.
Through trigger is it possible? if possible please help us along wih code.
Thanks in Advance
We have one Requirement Hear we have some fields in the opportunity those are Status,Help,Description. Here we want to entering some details in the Description field for that time automatically Task should be create with Subject name TestDescription.
Through trigger is it possible? if possible please help us along wih code.
Thanks in Advance
Please find updated code.
Please let us know if you need further help.
Please accept my solution as Best Answer if my answer was helpful. It will make it available for other as the proper solution. If you felt I went above and beyond, You can give me kudos.
Thanks and Regards
Sandhya
All Answers
Though this can be done using a trigger, but why not utilize the point and click feature of salesforce to meet your requirement.
This will help reduce your code maintenance and your writing of test classes while deploying the code to production.
Also, you can refer process builder as well.
https://developer.salesforce.com/trailhead/en/project/quickstart-process-builder
Hi Srini ,
You can write a trigger to create a task when opportunity field is updated.
Thanks and Regards
sandhya
Thanks for your solution.My problem is I want to entering something in Description Field it will create automatic Task with the subject "Follow up test task".The above code is the best solution in that code based on stage name they were updated.But my requiremenr is: For example In Description Field am Entering "Test task" so for that time task should be created with the subject Test Task.
Description Field is the Oppty field: Based on this field create a brand new task.
Can you please Help us for complete Trigger. because am the new guy for this. Will appricate you.
Once again thanks for your concern!....
Thanks in Advance.
Below code works. Hope this helps you.
Thanks and Regards
sandhya
That's awsome....Working fine.
But hear one problem after creating the task.We need to assign that particular task to one of the Group member. after completion the task, completion mail should be getting opportunity Manager like.
Hello XXX,
Your Task has been Completed. Here are the details -
Subject : Test
Status : Completed
Priority : Low
Can you please help us that would be great for us.
Thanks in Advance.
Above trigger is working but i havn't updated any field,Automatically created a task.But i want to updated one field called as Description after that a brand new task should be create.Can you please tell me where i need to updated the field in the trigger.
Thanks
Please find updated code.
Please let us know if you need further help.
Please accept my solution as Best Answer if my answer was helpful. It will make it available for other as the proper solution. If you felt I went above and beyond, You can give me kudos.
Thanks and Regards
Sandhya
It was super.Thank you so much.
The Above code is working fine but we are using before insert and before update.But i want to use proper subject name.
For example: If i give the name in the description field like "IM Test Description" the same name should be populate in the task subject name along with "Follow up Task". Finally output should be like this Subject name in the Task: "IM Test Description Follow up Task".how we can acheive this.
Can you please help us.
Thanks in Advance
Please replace tsk.Subject = 'Follow-up test task';
line with below code
Please let us know if this helps you.
Thanks and Regards
sandhya
We have added the above line that's awsome....Working fine. Thank you so much for your help!...
I have given the best ansawer the one which you have provided the solution.
please help below issue also.
But hear one problem after creating the task.We need to assign that particular task to one of the Group member. after completion the task, completion mail should be getting opportunity Manager like.
Hello XXX,
Your Task has been Completed. Here are the details -
Subject : Test
Status : Completed
Priority : Low
Can you please help us that would be great for us.
Thanks in Advance.
I will work on that and let you know.
Thanks and Regards
sandhya
I hope you for the solutin the ablove one..Please help us.
Thanks
Did you work on that and stuck somewhere, then please post your code I will help you.
Meanwhile i will also try to work on that.
Thanks and Regards
sandhya
After creating automatic task along with proper comments,we are not able to find Publicgroups in AssignTo Field in the Task page layout.don't know how to acheive this.Is there any other way to sending completion mails to Opty owners and their managers.Please help us.
Thanks