function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Clap MasterClap Master 

Setting business hours on case

I want to set the business hours on a Case in Apex, but am having trouble doing it - it appears that Apex lets me say, for example:

 

case.BusinessHours = businessHoursObject;

 

But it doesn't look like it's refelected on the case.  Also, I can't see any references to the BusinessHours field of a Case in the docs, yet it's available in the UI.

 

Has anyone done this?

davidjgriffdavidjgriff
I believe you want to set case.BusinessHoursId = bhObject.Id;