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
DRPowerUserDRPowerUser 

Validation Rule - Populate Text if field is blank

I was trying to use the BLANKVALUE formula to populate the Opportunity Name in a custom text field if the field is currently blank.  I don't know if I need to create an IF formula at same time since if field is not blank, then ignore.

 

Every time I create formula I get syntax error.

 

Here's how far I got

 

BLANKVALUE (Custom_Text_Field_c, Name)

 

 

SFDCRRSFDCRR
 len(fieldname>=0)
Message Edited by SFDCRR on 10-29-2009 03:25 PM
DRPowerUserDRPowerUser

Unfortunately, I'm no further ahead.   The formula in Excel would be:

 

IF(FieldName1="",Name,"")

 

In other words, if the fieldname1 field is populated, leave as is.  However, if blank, populate with Opportunity Name Text.

 

I just am unclear on how to do in SFDC.

werewolfwerewolf

First of all, this kind of thing would be done either in a formula field or in a workflow rule, not in a validation rule.  Validation rules just generate errors, they do not set field values.

 

Other than that, the Salesforce.com syntax is exactly the same as the Excel one: IF(test, value_if_true, value_if_false)

werewolfwerewolf

But rereading your original post, what you really want is a workflow with a field update.

 

Your workflow would be on Opportunity and the criteria would read:

 

MyField    equals   

 

(leave that last field blank)

 

Then add a field update, and update the MyField field to Name (where Name is the name of the field you want the data to come from).