You need to sign in to do that
Don't have an account?
emilyftw
BusinessHours - using addGMT
I am getting an error when getting the default BusinessHours and adding 1000 milliseconds. Here is the code I am running in the system log:
BusinessHours bh = [select id from businesshours where isDefault = true]; DateTime dt = System.now(); DateTime test = BusinessHours.addGmt(bh.id, dt, 1000);
And this is what the log shows:
13:58:42.297|METHOD_ENTRY|[3]|BusinessHours.add(String, Datetime, Long) 13:58:42.298|METHOD_EXIT|[3]|BusinessHours.add(String, Datetime, Long) 13:58:42.298|FATAL_ERROR|Internal Salesforce.com Error
Am I doing something wrong?
In case anyone else is struggling with this, I found that I needed to create a variable for the interval instead of passing it in directly. Here is the revised code that is functional: