We have a requirement:
We have fields in the opportunity called as MIDescription
Whenever we entered in the description field it should create a new brand task in the Open Activities related list. For that we have created a one trigger in opportunity mentioned below. Trigger is working but we haven't updated anything in the Description field but it has automatically creating a new task.
Can you please help us the trigger where i made the mistakes.
Trigger Description on Opportunity(before insert, before update) {
Set < Id > opIds = new Set < Id > ();
List < Task > taskList = new List < Task > ();
List < Opportunity > Opps = Trigger.new;
//List<Opportunity> taskOps = [Select Id,Help__c,Description__c from Opportunity where Id in :opIds];
for (Opportunity Opp: Opps) {
Task t = new Task();
t.WhatId = opp.Id;
t.Subject = 'Task';
taskList.add(t);
}
insert taskList;
}
Thanks in advance.