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
jtretakoffjtretakoff 

Basic question...baffled

Hi, I know this is probably one of the most basic questions, but I've scoured this board and the online help, and I'm at a loss.

I have created a custom field in my Opportunity, called LiveDate. I want to create a second filed that calculates LiveDate + 6 months.

The field name is LiveDate; the API field is LiveDate__c. When I do the formula:

LiveDate + 180

Or

LiveDate__c + 180

I get the following message:

Error: Field LiveDate__c does not exist. Check spelling.

Help? What basic thing have I overlooked?
NPMNPM
Are you selecting LiveDate using the Insert Merge Field drop down on the formula builder?
jtretakoffjtretakoff
Doesn't appear as a merge field, as it doesn't appear in any of the available fields. All I see for fields are:
$Organization
$System
$User
$User Role

None of the subsequent merge fields show my LiveDate field.

I appreciate the help...
NPMNPM
That sounds very strange.  You are creating a Formula field in the Opportunity Object right?  Opportunity should be a selection and the Opportunity fields available for selection should be listed in the INser Merge field drop down.
NPMNPM
THe Advanced formula tab shows more fields to choose from.
jtretakoffjtretakoff
Ok, here's what I have done, start to finish:

1) Created a Custom field in Opportunity, called LiveDate. It's a type of Date.
2) In the General Options for the Custom Field, I click on Formula Editor.
3) The only Field Types that are displayed are as I described.

I see no Advanced tab. Am I just missing it?
rockchick322004rockchick322004
You are looking at the formula editor for the Default Value for your custom field.  In Default Values, you can only reference global variables (since Default Values are applied when a record is New and thus has no values yet).  To create a Formula Field (a custom field of type "Formula"), create another field, and this time select the field type = "formula".

Jeff TalbotJeff Talbot

There's a little confusion in this thread... You're trying to write a formula for a default value in a standard field. NPM provided some good feedback here, but applicable a standard formula field rather than a default value formula. Default value formulas are different. A default value formula can't use field values from the record, because the record is new and hasn't been saved yet with a value in the field. Therefore, Salesforce prevents you from using fields from the same object in a default value formula. That is why you don't see your field in the dropdown list, and that is why you get a "field doesn't exist" error when you try manually typing in the field API name.

To get what you need (a calculation of a date from another field + 6 months), you will need to use a formula that calculates AFTER the record is saved. Use a standard formula field if you don't want/need this date to ever be edited, or use a workflow rule and field update if you just want to put a default value in a field that may/can be updated later.

jtretakoffjtretakoff
Hallelujah. Basic functionality indeed. Thanks so much; that did it!!!