You need to sign in to do that
Don't have an account?
Florencio Castillo 15
Compile Error: Expecting '}' but was: '<EOF>' at line 8 column 1
Hello. I am getting this error: Compile Error: Expecting '}' but was: '<EOF>' at line 8 column 1
Here's the apex class:
trigger CompleteResolutionTimeMilestone on Case (after update)
{ if (UserInfo.getUserType() == 'Standard')
{ DateTime completionDate = System.now();
List<Id> updateCases = new List<Id>();
for (Case c : Trigger.new)
{ if (((c.isClosed == true)||(c.Status == 'Closed'))&&((c.SlaStartDate <= completionDate)&&(c.SlaExitDate == null))) updateCases.add(c.Id); }
if (updateCases.isEmpty() == false) milestoneUtils.completeMilestone(updateCases, 'Resolution Time', completionDate); // Pass your milestone parameters to the Apex Handler Class }}
Here's the apex class:
trigger CompleteResolutionTimeMilestone on Case (after update)
{ if (UserInfo.getUserType() == 'Standard')
{ DateTime completionDate = System.now();
List<Id> updateCases = new List<Id>();
for (Case c : Trigger.new)
{ if (((c.isClosed == true)||(c.Status == 'Closed'))&&((c.SlaStartDate <= completionDate)&&(c.SlaExitDate == null))) updateCases.add(c.Id); }
if (updateCases.isEmpty() == false) milestoneUtils.completeMilestone(updateCases, 'Resolution Time', completionDate); // Pass your milestone parameters to the Apex Handler Class }}
The Apex trigger code you provided seems to have a mismatched curly brace that is causing the "Expecting '}' but was: '<EOF>'" error. To resolve this issue, you need to add an extra closing curly brace at the end of the trigger.
Here's the corrected Apex trigger code: The code is now properly indented and the closing curly braces are placed correctly. Please make sure to check that the milestoneUtils class exists and is accessible from this trigger. Also, ensure that the class containing this trigger is saved and compiled successfully in Salesforce.
If this helps , please mark this as Best Answer.
Thank you.
I got this error now, Compile Error: Unexpected token '{'. at line 1 column 1
Can you post your code that is erroring out after the changes suggested by Subrat?
Thank you
Here is the code:
{
if (UserInfo.getUserType() == 'Standard')
{
DateTime completionDate = System.now();
List<Id> updateCases = new List<Id>();
for (Case c : Trigger.new)
{
if (((c.isClosed == true) || (c.Status == 'Closed')) && ((c.SlaStartDate <= completionDate) && (c.SlaExitDate == null)))
{
updateCases.add(c.Id);
}
}
if (updateCases.isEmpty() == false)
{
milestoneUtils.completeMilestone(updateCases, 'Resolution Time', completionDate); // Pass your milestone parameters to the Apex Handler Class
}
}
}