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
Joe_IpsenJoe_Ipsen 

Default Date value not working

I am attempting to build a Custom Date field "Deployment Date" on the Asset object that is editable, but starts with the default value of another date field "Support Start Date" + 30 days.  This field is also on the Asset object.

 

That's it.  Pretty darn simple, and yet, the field is not populated with anything not even when I open a new record. 

 

This should be a fairly simple issue, but I can't find any explanation for why it is not working in the documentation.  Here's the most direct documentation I was able to find.

 

https://na4.salesforce.com/help/doc/user_ed.jsp?loc=help

Best Answer chosen by Admin (Salesforce Developers) 
Joe_IpsenJoe_Ipsen

I received the following suggestion from SFDC Support and was able to resolve the issue:

 


This case was logged because you assigned a default value to the "Deployment End Date", but newly created records were not getting populated with any values.

This is because the formula used for the default value was coming from another field on Assets that did not have a value upon creation.  (When you click new Asset there is no value pre-populated for "Support Start Date" so the formula could not calculate)

As a workaround to get the "Deployment End Date" to populate with the "Support Start Date"+30  you can create a workflow rule that trigger when the "Support Start Date" is "not equal" to Blank/Null.  Then use a field update to update the "Deployment End Date".  The value will then get populated on save.

To create the workflow rule navigate to:

Setup | Create | Workflow and Approvals | Workflow Rules

1. Click New to begin the creation of the rule.
2. Select Assets as the target object.
3. Create the rule name.
4. You can trigger this using any of the evaluation criteria, but you may want to consider the following:

When a record is created, or when a record is edited and did not previously meet the rule criteria ****If the criteria is "Support Start Date is not equal to Blank/Null" then it will not trigger again if the "Support Start date is changed)

Only when a record is created ****You will not be able to trigger the rule for existing records

Every time a record is created or edited ****This will trigger each time a record is saved and there is a value in the "Support Start Date".

5. I have included a screen shot of the trigger criteria.
6. After setting the rule criteria click save and next
7. Use the drop down on the next page to select "New Field Update"
8. Set a name for the field update then select "Deployment End Date" as the field to update.
9. Use the syntax SupportStartDate__c + 30 to populate the value.


 

 

All Answers

Nick1746323Nick1746323
I'm curious how exactly you're trying this? I looked at the options for setting default value as a formula, but you can't select other fields in the same object.
Joe_IpsenJoe_Ipsen

The Default Value allows you to "Insert Field" which I used to get the below formula:

 

Default Value:   SupportStartDate__c + 30 

 

In my experience, Date can be manipulated in Formulas as a decimal where 1 = 1 day.  0.02 ~ 1 minute, etc.

AbudandyAbudandy

Hi,

 

 

In fact I am encountering the same issue.

 

The Goal: to set a default date based on 'status' field picklist (when set to "delivered").

 

The result: an empty date field.
___
 

The formula (which is apparently OK after 'checking syntax'):

IF( ISPICKVAL(status, "Delivered"), now(), NULL)

___

 

I am likely late to the parade on this as I see the thread is more than a month old, but any help would be much appreciated!

 

Tx,

Joe_IpsenJoe_Ipsen

I received the following suggestion from SFDC Support and was able to resolve the issue:

 


This case was logged because you assigned a default value to the "Deployment End Date", but newly created records were not getting populated with any values.

This is because the formula used for the default value was coming from another field on Assets that did not have a value upon creation.  (When you click new Asset there is no value pre-populated for "Support Start Date" so the formula could not calculate)

As a workaround to get the "Deployment End Date" to populate with the "Support Start Date"+30  you can create a workflow rule that trigger when the "Support Start Date" is "not equal" to Blank/Null.  Then use a field update to update the "Deployment End Date".  The value will then get populated on save.

To create the workflow rule navigate to:

Setup | Create | Workflow and Approvals | Workflow Rules

1. Click New to begin the creation of the rule.
2. Select Assets as the target object.
3. Create the rule name.
4. You can trigger this using any of the evaluation criteria, but you may want to consider the following:

When a record is created, or when a record is edited and did not previously meet the rule criteria ****If the criteria is "Support Start Date is not equal to Blank/Null" then it will not trigger again if the "Support Start date is changed)

Only when a record is created ****You will not be able to trigger the rule for existing records

Every time a record is created or edited ****This will trigger each time a record is saved and there is a value in the "Support Start Date".

5. I have included a screen shot of the trigger criteria.
6. After setting the rule criteria click save and next
7. Use the drop down on the next page to select "New Field Update"
8. Set a name for the field update then select "Deployment End Date" as the field to update.
9. Use the syntax SupportStartDate__c + 30 to populate the value.


 

 

This was selected as the best answer