App Customization Specialist Superbadge Step #2 - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Elena GrebenykElena Grebenyk 

App Customization Specialist Superbadge Step #2

Hi!
I am having some trouble with this step 2.

Challenge Not yet complete... here's what's wrong: 
The 'IsShiftVolunteer' field formula on the 'Volunteer Shift Workers' is not resulting in a check box when the logged in user is the volunteer, and unchecked when they are not.

I don't have any ideas how to realize this formula.

Thahks.
Best Answer chosen by Elena Grebenyk
Adithya SreyajAdithya Sreyaj
Try this:

$User.Id == Volunteer__r.Id

Regards,
Adithya

All Answers

Vinit JoganiVinit Jogani
Hi,

I am also getting this error. I used below formula for the field:
IF(Volunteer__c = $User.Id, true, false )
I see this works by creating the required records, but somehow the Challenge is not accepting this.
Adithya SreyajAdithya Sreyaj
Try this:

$User.Id == Volunteer__r.Id

Regards,
Adithya
This was selected as the best answer
Elena GrebenykElena Grebenyk
Just write $User.Id == Volunteer__r.Id (without IF())
Vinit JoganiVinit Jogani
Thanks Adithya, this works. Also in place of Volunteer__r.Id, you can use Volunteer__c. This will save a reference:

$User.Id == Volunteer__c
Stephane PlanckeStephane Plancke
Hi I have the next problem: The 'Shift Hours' field on the 'Volunteer Shift' record is not working as expected.

question is: Volunteer Shift calculates the number of hours a shift lasts from the start and end times.

my formula is: Shift_End_Time__c - Shift_Start_Time__c
Vinit JoganiVinit Jogani
Hi Stephane,

you can use following formula:

FLOOR ((Shift_End_Time__c - Shift_Start_Time__c)*24)
  1. The requirement is of hours, end time minus start time will give you value in terms of days. Thus multiply by 24.
  2. Expectation is in completed hours so useing FLOOR function.
Sabrina ChenSabrina Chen
FLOOR should not be used in this case, or it would cut off the half an hour shift time, like 12PM - 10:30AM would yield 1 hour instead of 1.5 hours. Removing FLOOR would give the correct time difference.
JP RogersJP Rogers
I'm still getting this error....and I've tried the above. ERROR: "Challenge Not yet complete... here's what's wrong: 
The 'IsShiftVolunteer' field formula on the 'Volunteer Shift Workers' is not resulting in a check box when the logged in user is the volunteer, and unchecked when they are not." FUNCTION: it is functioning as expected when I log in as Dan Wong but have myself as volunteer it goes to False; then I go back to record as me with myself as Lookup and it is then checked??????User-added image
Vinit JoganiVinit Jogani
Hi,
It seems Challenge is not checking for actual behavior but rather the formula used. I too created the formula as mentioned above and it was working fine. But the challenge was passed only after using the couple of formulas as mentioned below:
  1. $User.Id == Volunteer__r.Id
  2. $User.Id == Volunteer__c
Tiffany NairneTiffany Nairne
HI all,
I can say Sep 2019, that Adithya has saved my day with this tip. Cheers!
 
MPB SalesforceMPB Salesforce
Hi all if you face any error related to this super badge so once try this video series I hope you will get solution
https://www.youtube.com/watch?v=Qw_wC7_OYN4
MPB SalesforceMPB Salesforce



*****************************************************************************
*****************************************************************************
*****************************************************************************
*****************************************************************************
Hi all if you have any query related to this badge so please watch this video
series I hope you will get all solution related to challenge 4

and this is free of cost

https://www.youtube.com/watch?v=-IXu8bYfjE4

*****************************************************************************
*****************************************************************************
*****************************************************************************
*****************************************************************************
Bharat IntiBharat Inti
I just cleared this step by using $User.Id==Volunteer__r.Id. But I don't understand why IF() function shouldn't be used. Ideally it should be IF($User.Id==Volunteer__r.Id,True,False)
Subhasis DharSubhasis Dhar
Please make sure, IsShiftVolunteer field is selected as Formula datatype with return type checkbox. Dont select datatype itself as Checkbox.
wang shaohuawang shaohua
you maybe need to check the accessibility.
wang shaohuawang shaohua
if cannot use 
$User.Id == Volunteer__r.Id
to pass it, you maybe need to check the accessibility.