Here it is the Trigger on Event Activity
trigger eventHistoryChecker on Event (after update)
{
/////////
//This is the Trigger handles record updates from the Event Obj
/////////////
for (Event evt : Trigger.new)
{
//Access the Old Event record by its IDoldevt in= Trigger.OldMap
Event oldevt=Trigger.oldMap.get(evt.id);
//Trigger.New records are conveniently the New versions!
String oldSub String= oldSub=oldevtoldevt.Subject;
string newSub=evtnewSub = evt.Subject;
if(newSub.equals(oldSub)) { }
else evt.addError('Can not change Subject Field');
}
}
Here it is the Test Class for this Trigger but i am not sure its correct or not plz help me to resolve the problem
@isTest
public class eventHistoryChecker_TC
{
static testmethod void TestMeth()
{
Event e=new Event();
e.subject='Call';
e.Ownerid='005900000037wZv';
e.EndDateTime=System.Today();
e.StartDateTime=System.Today();
insert e;
}
}