You need to sign in to do that
Don't have an account?
test vijay
How to Insert BusinessHours in Apex Class
Hello Guys,
I want to insert new BusinessHours in apex test class but such as i tried to insert BusinessHours from apex error is coming :DML operation Insert not allowed on BusinessHours.
However, we can create BusinessHours from setup but i want to create Business hours from Apex.
Thanks in advance
I want to insert new BusinessHours in apex test class but such as i tried to insert BusinessHours from apex error is coming :DML operation Insert not allowed on BusinessHours.
However, we can create BusinessHours from setup but i want to create Business hours from Apex.
Thanks in advance
Check below examples that can help you to insert business hours.
https://salesforce.stackexchange.com/questions/71771/how-could-i-test-a-businesshours-class-functionality-with-unit-tests
https://salesforce.stackexchange.com/questions/34474/creating-holidays-and-business-hours-in-test-code
Thanks,
thanks for your response.
I want to cover my following apex class.
From test class i am tring className.testBusinessHours();
but class is not getting cover with 100%. i don't want to create business hours from setup. does any way to insert business hours in apex test class.
let me know if any way.
Thank You
can u able to insert Bussiness hours in Apex main class ?