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
JoyceyJoycey 

Workflow triggers when field changes

Hi, What I would like to do is have an email sent when a field is changed. The problem I am having is that I don't want this email sent when the field is being changed from blank to populated. Only when a value in it is being changed.  Below is the code that I have tried using to do this, would there be any other suggestions? Many thanks
Nick

AND(
ISCHANGED(Assessment_Date__c),
NOT(ISNULL( Assessment_Date__c ))
)

 

Best Answer chosen by Admin (Salesforce Developers) 
sandeep@Salesforcesandeep@Salesforce
AND(
ISCHANGED(Assessment_Date__c),
NOT(ISNULL( Assessment_Date__c )),
ISNULL(PRIOR(Assessment_Date__c)) )

All Answers

Saurabh DuaSaurabh Dua

Which edition are you using ??

 

This funcitonality can only be achieved using triggers .. In workflows you cannot map the the old data. 

If you want i can write down the code which you can use in additon to the workflow which will help you to achieve the fucntionality.

 

 

JoyceyJoycey

Thanks for the reply, I am using Enterprise Edition. Any help you can offer with the trigger would be much appreciated.

Many thanks

Nick

Rahul_sgRahul_sg
I think you can achieve it using a WF rule.

In your condition use PRIORVALUE(field)
(Returns the previous value for the field ) instead of just checking null.
sandeep@Salesforcesandeep@Salesforce
AND(
ISCHANGED(Assessment_Date__c),
NOT(ISNULL( Assessment_Date__c )),
ISNULL(PRIOR(Assessment_Date__c)) )
This was selected as the best answer
JoyceyJoycey

Hi all

I'd like to thank you for the assistance:

This is the code I finally settled on which appears to do the job well.

AND( 
Channel__c = "Channel", 
ISCHANGED(Assessment_Date__c), 
NOT(ISNULL(PRIORVALUE(Assessment_Date__c))) 
)

 I hope somebody will find this useful.

Many thanks
Nick