+ Start a Discussion
footprint_ninafootprint_nina 

Workflow rule for to populate "date" field with "date proposal submitted"

Hi,

I am trying to create a workflow rule so that whenever the stage (which is a picklist) on an opportunity is changed to "Proposal Submitted" and custom field, Date Proposal Submitted, will be automatically populated with the current date. This is what I have but  I keep getting an error message that I can't decipher.

 

IF(ISPICKVAL(StageName, "Proposal Submitted"), 
TODAY()  =  Date_Proposal_Submitted__c, null)

 

Error message: Error: Formula result is data type (Boolean), incompatible with expected data type (Date).

 

Thanks!

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

Are you looking for a workflow rule or a Formula(Date) field? 

 

If you want a Formula(Date) field then you want a formula something like 

IF(ISPICKVAL(StageName , "Proposal Submitted"),TODAY(), NULL)

 If you want a Workflow Rule with a Field Update then you need to set up something like this:

Workflow Rule Detail

Rule Name:    Set Date Proposal Submitted     
Object:    Opportunity
Active:    Checked    
Evaluation Criteria:    When a record is created, or when a record is edited and did not previously meet the rule criteria
Rule Criteria    
Opportunity: Stage equals "Proposal Submitted"


Workflow Actions

Immediate Workflow Actions:

Type:    Field Update    Date Proposal Submitted

Field Update Detail

Name:    Set Date Proposal Submitted          
Unique Name:    Date Proposal Submitted         
Object:    Opportunity         
Field to Update:    Opportunity: Date Proposal Submitted
Field Data Type:    Date
Formula Value:    TODAY() 

 


 

 

Message Edited by Stevemo on 12-09-2009 11:40 AM

All Answers

Steve :-/Steve :-/

Are you looking for a workflow rule or a Formula(Date) field? 

 

If you want a Formula(Date) field then you want a formula something like 

IF(ISPICKVAL(StageName , "Proposal Submitted"),TODAY(), NULL)

 If you want a Workflow Rule with a Field Update then you need to set up something like this:

Workflow Rule Detail

Rule Name:    Set Date Proposal Submitted     
Object:    Opportunity
Active:    Checked    
Evaluation Criteria:    When a record is created, or when a record is edited and did not previously meet the rule criteria
Rule Criteria    
Opportunity: Stage equals "Proposal Submitted"


Workflow Actions

Immediate Workflow Actions:

Type:    Field Update    Date Proposal Submitted

Field Update Detail

Name:    Set Date Proposal Submitted          
Unique Name:    Date Proposal Submitted         
Object:    Opportunity         
Field to Update:    Opportunity: Date Proposal Submitted
Field Data Type:    Date
Formula Value:    TODAY() 

 


 

 

Message Edited by Stevemo on 12-09-2009 11:40 AM
This was selected as the best answer
footprint_ninafootprint_nina
Thanks! The workflow rule worked great!
Steve :-/Steve :-/
No problem, glad it worked.:smileyhappy:
footprint_ninafootprint_nina

Hi!

I've just discovered a snag in my workflow rule that I'm sure is pretty easy to correct, but I'm not sure how. The workflow rule i created changes the "date proposal submitted" field to the current date and does not allow post-dating. I was hoping to create a rule that will automatically populate that field with the current date if you change the stage of an opportunity to proposal submitted, but still let people retroactive change the date of older opportunities to be the correct date that a proposal was submitted.

 

Thank you!

Steve :-/Steve :-/

yikes!  

 

If you need to allow users to Post-Date the Date Proposal Submitted field, then you may have to give up on using a Workflow Rule with a Field Update.  

 

I think you might have to just have a Validation Routine that evaluates the Opportunity.Stage and Date Proposal Submitted fields, and gives the user an error if the Date Proposal Submitted is > TODAY.  

footprint_ninafootprint_nina

I just can't seem to get this right. I have 2 different Opportunity Record Types with similar custom fields (Application Submitted and Date Proposal Submitted). And i want to create 2 separate validation rules that will apply to each opportunity record type. I got the rules down just fine, but then they both applied to both record types. Now i am trying to fix the rules and this is what i have, but i am getting an error.

 

IF( $RecordType.DeveloperName = "Project Development") AND(ISPICKVAL( StageName, "Proposal Submitted"),   ISNULL( Date_Proposal_Submitted__c ))

Steve :-/Steve :-/

Hi Nina,

 

Is that formula from a Validation Formula you're trying to run, or a Formula Field that you're trying to calculate?  

 

What exactly is the error message that you're getting?  Can you upload a screen shot of your Formula Editor screen with the Syntax Error message? 

Message Edited by Stevemo on 01-06-2010 04:37 PM
footprint_ninafootprint_nina

I'm just trying to do a validation rule, well 2 validation rules that will apply to similar fields on 2 separate opportunity records types. 'm not sure how to upload a picture to this because it's asking for  URL and i have the screen shot saved as a jpg. but right now the error message says: Error: Syntax error. Extra AND. But  i tried removing the AND and then it said "extra ISNULL".

 

 

Steve :-/Steve :-/

Give this one a shot

 

 

AND ( $RecordType.DeveloperName = "Project Development",

ISPICKVAL( StageName, "Proposal Submitted" ),

ISNULL( Date_Proposal_Submitted__c ))

 

 

 

Message Edited by Stevemo on 01-06-2010 05:16 PM
footprint_ninafootprint_nina

i got it working for the other record type (record type = donation) but for record type = Project Development, it allows me to change the stage to proposal submitted and save the opportunity even if no date is entered.

 

Steve :-/Steve :-/
Are you trying to do this all in one Validation Formula?  For the sake of simplicity I think you might want to split it into 2 seperate ones, otherwise you're going to have to join them using an OR statement.
footprint_ninafootprint_nina
yeah i am doing it with 2 validation rules. i copied what you sent before and just changed the record type to donation and that one works fine. but for the Project Development rule, it just lets me save it.
Steve :-/Steve :-/

Can you post a list of all of the fields, record types, and datatypes that you are trying to evaluate in your formulas?  I just tested this on my Dev Org and it worked fine.

 

Are there 2 Record Types, 1 Picklist Field, and 2 Date Fields?

 

So 

 

IF Record Type = A and Picklist = 1 then DateField 1 is required

OR

IF Record Type = B and Picklist = 1 then DateField 2 is required 

 

Is that close?

Message Edited by Stevemo on 01-06-2010 05:50 PM
footprint_ninafootprint_nina
that is exactly it!
Steve :-/Steve :-/

Then that validation formula should work.  You just need to clone the one that is working and point it to the other Record Type and Fields that you want to evaluate.  Can you copy and paste the exact 2 formulas that you are currently using so that I can see them?

 

They should look something like this:

 

Formula 1

 

AND ($RecordType.DeveloperName = "RecordType1", ISPICKVAL(StageName, "Proposal Submitted" ), ISNULL(DateField1))

 

 Formula 2

 

 

AND ($RecordType.DeveloperName = "RecordType2", ISPICKVAL(StageName, "Proposal Submitted" ), ISNULL(DateField2))

 

 

 

 

 

footprint_ninafootprint_nina

Here is the first one:

 

 

AND ( $RecordType.DeveloperName = "Donation", ISPICKVAL( StageName, "Proposal Submitted" ),ISNULL( Application_Submitted__c ))

 

 and the second one:

 

 

AND ($RecordType.DeveloperName = "Project Development", ISPICKVAL(StageName, "Proposal Submitted" ), ISNULL( Date_Proposal_Submitted__c ))

 

 

 

 

Steve :-/Steve :-/

I've got it!  we had $RecordType.DeveloperName  instead of  $RecordType.Name

 

 

AND($RecordType.Name = "Donation",

ISPICKVAL(StageName, "Proposal Submitted"),

ISBLANK(Application_Submitted__c ))

also, you can use either ISNULL or ISBLANK 

 

AND($RecordType.Name = "Project Development",

ISPICKVAL(StageName, "Proposal Submitted"),

ISNULL(Date_Proposal_Submitted__c))

 

 

Message Edited by Stevemo on 01-06-2010 10:09 PM
footprint_ninafootprint_nina
that's great! thanks so much (again)!!
Steve :-/Steve :-/
petec@i2isyspetec@i2isys

I have a similar problem.  I'm trying to create a workflow rule to run a field update.  If someone fills in a date on a case that has a parent case, then I want the parent case date field to update with the same date.  So for instance, the child case has a date field called 'interface completed'.   When an agent fills in that date field I would like it to fill in the same field on the parent case with the same date or at least with today's date. 

 

Is that even possible?