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
Frederick H LaneFrederick H Lane 

Using Formula Fielss - Challenge. Create a Formula Field between dates

I'm in the Trailhead challenge; "Create a formula field that determines the number of days between today and the last activity date for a case's account."

I have created the Case Field "Days Since Last Update"
and completed the formula field as;  TODAY()  -   Account.LastActivityDate

But the error message I get back is:
"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: [Amount_bud_Non_Currency_geted__c]: [Amount_bud_Non_Currency_geted__c]"

What's wrong?
Best Answer chosen by Frederick H Lane
Amit Chaudhary 8Amit Chaudhary 8
Please create the new developer org and try again same step in new developer org. Or please check "Amount_bud_Non_Currency_geted__c" field on case and account object.
 

All Answers

Ashish GargAshish Garg
Formula looks fine, but this is regarding error while saving record, you have missed a field value.

Error says: you have missed the required field Amount bud Non Currency geted (Amount_bud_Non_Currency_geted__c) while saving the record.
  1. If you are using native salesforce page, then look for the field in page, you must find it there and provide some respective value.
  2. If you are using some API, then look for the code and incude the field value there, since this is required
  3. If any custom VF page, then include the field in page so it can be filled.
Amit Chaudhary 8Amit Chaudhary 8
Please check below post for same issue
1) https://developer.salesforce.com/forums/?id=906F0000000BSUKIA4

NOTE:- It look like you created "Amount_bud_Non_Currency_geted__c" field as required field on case object. Open the "Amount_bud_Non_Currency_geted__c" field and remove the Required field check box.
 
Frederick H LaneFrederick H Lane
I don't see a field of that name? The only custome field I have on the Case object is Days Since Last Update?
Amit Chaudhary 8Amit Chaudhary 8
Please create the new developer org and try again same step in new developer org. Or please check "Amount_bud_Non_Currency_geted__c" field on case and account object.
 
This was selected as the best answer
Ashish GargAshish Garg
Can you get the debug log here.

There must be some/any trigger on related objects, where with any conditional statement the field Amount_bud_Non_Currency_geted__c must be filled out in the triggers. Search the field name in debug log and line number where exception got occured, then in code look for the line, you will get the object and conditions as well which is not satisfied in the case.
Frederick H LaneFrederick H Lane
Many thanks. I did. And the problem is, for some reason there was the field name on the Account object called "Amount budgeted(Non-Currency)geted". This indeed did have the checkbox under General Options caleed "Always require a value in this field in order to save a record" checked. I uchecked it as well as unchecked all other possible fields. This resolved the problems and I was able to go back to all my 3 Trailhead challenges and get 3 x 500 points. 
I actually found the problem by editing into the Account object and checking what fields were required (Had the red vertical bar next to them). But I'd love to know how the Debug or other methods find this fault quicker.
But, why does this happen.
Many thanks for your help.