Default Date Value Not Populating

  • 1
  • Problem
  • Updated 2 years ago
  • Solved
The salesforce default date that I have set is not displaying in the "Date Received" field when a user is creating a new record.

Photo of Brayden Smith

Brayden Smith

  • 1,078 Points 1k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Matt Small

Matt Small

  • 1,182 Points 1k badge 2x thumb
Are you sure the new record is querying a model?
Photo of Christine Jessen

Christine Jessen

  • 670 Points 500 badge 2x thumb
Brayden -

Can you send a screenshot of your model and conditions you have defined for this component?

There's two main ways to set a default field value:

1.) In your model condition, set a condition such that:
Date_Received__c = TODAY
Remember to uncheck "Load Model Data on Page Load" and check "Create Default Row if Model Has None" in this scenario.

2.) Using the action framework to launch your Search component, use an "Update a field on row(s)" as one of the actions.  Likewise, remember to uncheck "Load Model Data on Page Load" and you can use the action framework to create a new row when launching this component.

Hope this helps!
Christine
(Edited)
Photo of Brayden Smith

Brayden Smith

  • 1,078 Points 1k badge 2x thumb
Skuid doesn't pull through the default Salesforce value? I have the value set in the custom field settings on the custom object.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Brayden,

Two things to check:  
1. Is this a brand new record?
If it's an existing record in the database, default values will not apply.

2. I may be wrong here, but I believe Skuid doesn't get the default value from SFDC until after save. You could do the following to test the theory: Create a new record in the skuid ui; leaving the field for which you have a default value blank, save it; query the skuid model and see if the default value has been applied.
Photo of Christine Jessen

Christine Jessen

  • 670 Points 500 badge 2x thumb
Yes Matt is correct - Skuid applies the SF default values only after the save.  If you want the default value to show up in the UI when creating a new row, you'll have to preset the value either via a condition or action framework field update.