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
Christine LuoChristine Luo 

App Customization Specialist Challenge 2-- Shift Hours

Hello,
I got this message for the Shift Hours field which I thought would be a simple fomula (Shift_End_Time__c  -  Shift_Start_Time__c). The Return field is Number.

"The 'Shift Hours' field on the 'Volunteer Shift' record is not working as expected."
What did I wrong?

Thanks!
Best Answer chosen by Christine Luo
Narender Singh(Nads)Narender Singh(Nads)
Hi,

Try using this formula:
( Shift_End_Time__c - Shift_Start_Time__c ) *24

Worked for me.

Thanks.

All Answers

Ekta KanderaEkta Kandera
Hi Christine, 

Try this FLOOR ((Shift_End_Time__c - Shift_Start_Time__c)*24) for Shift Hours field.

Thanks!

 
SandhyaSandhya (Salesforce Developers) 
Narender Singh(Nads)Narender Singh(Nads)
Hi,

Try using this formula:
( Shift_End_Time__c - Shift_Start_Time__c ) *24

Worked for me.

Thanks.
This was selected as the best answer
Christine LuoChristine Luo
Yes,  I passed the step after implemented the change. Thanks!
Salesforce DokariSalesforce Dokari
Why are we multiplying by 24?
Ishika UdunIshika Udun
Same question here. Why we multiplied it with 24? I did subtract only did not work and tried multiplying by 24 and it worked... I want to learn why we multiplied it with 24 please?