• Sanjay Ramchandani 58
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
How do I associate Entitlements to a Case creation without a account ?
Hello,

I am working on enttilement process, where I am updating chechkbox(reset milestone) on case object whenewer milestone is violated. Then my trigger fires which checks whether 'reset milestone' is true or not. If it is true then trigger will fire and milestone will reset. For this i am putting system.now() in start date field on casemilestone object.

Well, My issue is I am able to reset milestone through this processs when i edit case and then save. But I want this procedure should run automatically. When check box get checked then trigger wont fire till i am not editing the case. Is there any way to run this automatically?

Here is the code i am using to reset the milestone.

trigger startdate on Case (after update) {
List<CaseMilestone> cmUpdatedList =new List<CaseMilestone>();
List<Case> cList = [SELECT CaseNumber, AccountId, Id, ContactId, Reset_Milestone__c, Subject, Description, ContactEmail, contact.name,  Product__c, SuppliedEmail 
FROM Case WHERE Reset_Milestone__c = true AND Id IN :Trigger.new];  
List<CaseMilestone> cmList= [SELECT Id , CaseId, StartDate, IsViolated, case.Reset_Milestone__c, IsCompleted FROM CaseMilestone where CaseId =: cList AND IsCompleted = false];
for(case cd : cList)
{
   if(cd.Reset_Milestone__c == true )
   {
       for(CaseMilestone cms : cmList)
       {
               cms.StartDate =  System.now();
               system.debug('********cms.StartDate*********'+cms.StartDate);
               cmUpdatedList.add(cms);
       } 
         
       
   }
   Update cmUpdatedList;
   
}
  }

Thanks,
Utz
  • December 01, 2017
  • Like
  • 0
Hello,

I am using entitlement process. I want to reset milestone when we will update case on case feed. When we will click on update button then milestone success action should fire but milestone should run again and again. How is  this possible?

Thanks,
Utz
  • November 23, 2017
  • Like
  • 0