You need to sign in to do that
Don't have an account?
Nicholas Hale 5
Create a Number formula that calculates the volume of a cylinder
Your company sells cylindrical hyperbaric chambers. You need a formula field that calculates the volume of a cylinder for you, rounded to the nearest whole number, given its radius and height. Use the existing mathematical formula for the volume of a cylinder, V = πr2h, where r is the radius of the cylinder, h is the height, and π is the constant Pi. Note: Although this formula field might best be created on a custom object, for simplicity, we’ll create this formula on the Opportunity object.
>Create 2 custom fields of type Number on the Opportunity object: ‘radius’ with a resulting API name of ‘radius__c’ and ‘height’ with a resulting API name of ‘height__c’.
>The formula should be named ‘Cylinder Volume’, with the resulting API name ‘Cylinder_Volume__c‘ and should be created on the Opportunity object.
>The formula should reference the custom fields ‘radius__c‘ and ‘height__c‘.
>The formula should use 3.14159 as an approximation of Pi.
Heres the challenge that im stuck on. i have created the 2 custom fields. What im stuck on is where do we create the formula. Do we put it in the custom fields or is there another place u insert it?
thanks if anyone can help
>Create 2 custom fields of type Number on the Opportunity object: ‘radius’ with a resulting API name of ‘radius__c’ and ‘height’ with a resulting API name of ‘height__c’.
>The formula should be named ‘Cylinder Volume’, with the resulting API name ‘Cylinder_Volume__c‘ and should be created on the Opportunity object.
>The formula should reference the custom fields ‘radius__c‘ and ‘height__c‘.
>The formula should use 3.14159 as an approximation of Pi.
Heres the challenge that im stuck on. i have created the 2 custom fields. What im stuck on is where do we create the formula. Do we put it in the custom fields or is there another place u insert it?
thanks if anyone can help
Additionally, try either of the following, as it may be a weird order of operations issue that you could also be running into:
Or
The latter worked for me.
All Answers
After you click next, then you'll specify the formula ( Pi * r^2 * h), and plug in the appropriate fields and values.
Hope that helps.
The 'Cylinder_Volume__c' formula field did not return the correct value for a input values of Height of 10 and a Radius of 10. The expected value from the Cylinder_Volume__c formula was 3142.. im getting this error messege. 3.14159 * radius__c ^2 * height__c. this is my formula.
Additionally, try either of the following, as it may be a weird order of operations issue that you could also be running into:
Or
The latter worked for me.
thank so much from spain!
Might help for some one who face the same issue, Make sure Cylinder_Volume__c without deceimals
Here's my formula for this trailhead: (3.14159 * radius__c * EXP(2) * height__c)
And this is the error I get, "Challenge Not yet complete... here's what's wrong:
The Opportunity object does not contain the correct formula fields per the requirements. Tip: check for typos in the field names."
I have checked the field names/types for each field and confirm that they are correct. Has anyone seen this issue.
i have checked the decimal points as well, but is not working
Here's my error: Challenge Not yet complete... here's what's wrong:
The Opportunity object does not contain the correct formula fields per the requirements. Tip: check for typos in the field names.
Here's my formula: Round(3.14159 * Height__c * (Radius__c^2),0)
Any Suggestions?
Challenge Not yet complete... here's what's wrong:
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Discount_Percent__c]: [Discount_Percent__c]
What does the discount have to do with the cylinder?
I bet this is a bug of Trailhead.
This is my error message:
Challenge Not yet complete... here's what's wrong:
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Discount_Percent__c]: [Discount_Percent__c]
1 - Create 2 custom fields of type Number on the Opportunity object:
‘height’ with a resulting API name of ‘height__c’.
Boths with type number
2. Create 1 custom fields of type formula in the Opportunity object:
The formula should be named ‘Cylinder Volume’, with the resulting API name ‘Cylinder_Volume__c‘ and return number with number.
3. In the Simple Fomula insert the code bellow:
(radius__c ^2) * height__c * 3.14159
Assessment Completo!
+500 pontos
Advanced Formulas
See you guys.
Josué Peixoto
Challenge Not yet complete... here's what's wrong:
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Discount_Percent__c]: [Discount_Percent__c]
go to: object manager > opportunity > fileds and relationships > discount percent > click on Edit and then remove the "REQUIRED" checkbox under general options.
sakkyo :-)
Every people doing directly insert an opportunity object . just check if opportunity object is validation rule is applied or not, if applied deactivate that rule and try the challenge. (It shows REQUIRED_FIELD_MISSING, Means your validation rule applied)
This is my error message:
Challenge Not yet complete... here's what's wrong:
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Discount_Percent__c]: [Discount_Percent__c]
Raviteja:)
Select the 3 fields and make sure the Field Access "Visible" and at least "Read Only" are checked for all profiles.
Simon Dağcı
Setup-->Object Manager --> Choose (Opportunity)-->Fields-->Edit(Discount_Percent__c]) and uncheck required
This was selected as the best answer
Page: https://success.salesforce.com/answers?id=9063A000000l0JWQAY
2) Setup > Object Manager > Opportunity > Fields & Relationships > New > Number > Height
3) Setup > Object Manager > Opportunity > Fields & Relationships > New > Formula > Cylinder Volume > Cylinder Volume (Number) = 3.14159 * (radius__c ^2) * height__c
I had the formula error, but thing is that the problem is in the unit test under the Trailhead.
It works with simple formulas like this "3.14159 * radius__c * radius__c * height__c"
and it's not necessary to round by function. I workaround the bug in the unit test by
set required properties in
radius__c and height__c
General Options << Required << true //Always require a value in this field in order to save a record
//after this hack ti works doesn't matter is Required field is checked
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Discount_Percent__c]: [Discount_Percent__c]
Answer: uncheck required for Discount_Percent_c worked for above error
"go to: object manager > opportunity > fileds and relationships > discount percent > click on Edit and then remove the "REQUIRED" checkbox under general options."
ROUND(3.14159 * radius__c * radius__c * height__c,0)
Oh my God!
I cannot believe I was doing this in my production environment the whole time.
Just launch the Playground please and you're good to go.
Note: if everything else is checked by you completely.
1) Error:-
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Discount_Percent__c]: [Discount_Percent__c]
Solution:- Setup-->Object Manager --> Choose (Opportunity)-->Fields-->Edit(Discount_Percent__c]) and uncheck required.
2) Error:-
The Opportunity object does not contain the correct formula fields per the requirements. Tip: check for typos in the field names.
Solution:- Here you Created a new Playground for the Advance section and at the run Time you select the same but you forgot that you were created new objects in your previous Playground that you used for Admin Beginner or Admin Intermediate. So watch your every step while creating objects that you selected the right playground for your action.
2. You can use round function here or the below formula also works:
3.14159 * (radius__c ^2) * height__c
1) Setup > Object Manager > Opportunity > Fields & Relationships > New > Number > Radius
2) Setup > Object Manager > Opportunity > Fields & Relationships > New > Number > Height
3) Setup > Object Manager > Opportunity > Fields & Relationships > New > Formula > Cylinder Volume > Cylinder Volume
Formula: (radius__c ^2) * height__c * 3.14159
If an error occurs:
= Go to validation rules " CLOSE DATE ALERT"
- deselect active "checked box " under the rule name.
Error:-
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Discount_Percent__c]: [Discount_Percent__c]
Solution:- Setup-->Object Manager --> Choose (Opportunity)-->Fields-->Edit(Discount_Percent__c]) and uncheck required.
Go to: object manager > opportunity > fields and relationships > discount percent > click on Edit and then remove the "REQUIRED" checkbox under general options."
It worked for me and challege is completed successfully.
"We created an opportunity with radius and height values. We expected the 'Cylinder_Volume__c' field to show the correct cylinder volume, but it didn’t. Make sure that your formula uses the correct calculation for the volume of a cylinder, and that radius x radius is enclosed in parentheses".