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
Nevin O'Regan 16Nevin O'Regan 16 

Help With A Workflow formula and IF statement

Hi guys,

I want to send an email notification to users based on two field criterias. These are:
1. the payment method = Barter 
2. the payment amount field has been updated

I have created a custom field to capture the previous amount value when that field has been changed and I have built a workflow rule with a field update for this.

AND(
              ISCHANGED( Payment_Amount__c ),

              NOT(ISBLANK(TEXT(Payment_Amount__c)))
             )
Best Answer chosen by Nevin O'Regan 16
Soyab HussainSoyab Hussain
Hi Nevin O'Regan,
Try this, maybe this will help you.
AND(
   ISPICKVAL(Payment_Method__c , 'Barter'),
   ISCHANGED(  Previous_Value__c ),
   ISCHANGED(  Payment_Amount__c ) 
)

If you found it useful please appreciate my efforts and mark it as the best answer.

Thanks,
Soyab

All Answers

Danish HodaDanish Hoda
Hi Nevin,
While creating the WF, opt the third option - Evaluate the rule when a record is created, and any time it's edited to subsequently meet criteria.
And use ISCHANGED( Payment_Amount__c ) in the rule criteria.
Nevin O'Regan 16Nevin O'Regan 16
Hi Danish,

I'd also like to include in the statement that Payment_Method__c = Barter. Would this be an IF statement and if so where do I add it in?
Soyab HussainSoyab Hussain
Hi Nevin O'Regan,
Can you please put more description of your issue?
Nevin O'Regan 16Nevin O'Regan 16
Hi Soyab,

So I would like an email notification sent from the system if the Amount field is changed and the field Payment_Method__c = Barter. I have built a workflow rule which updates a custom field Previous_Value__c with the previous value of the Amount field when it has been changed.
I need this so I can include both fields in the email notification.
What I need is a workflow rule to fire when both the Amount field has been updated and the Payment_Method__c picklist field = Barter.
Ajay K DubediAjay K Dubedi
Hi Nevin,

I have gone through your question. Though you did not mention whether your payment method field is a string or picklist, 
I have created a formula for both cases. Please have a look - 
 
//if the payment method field is string
AND(
    ISCHANGED( Payment_Amount__c ),
    NOT(ISBLANK(TEXT(Payment_Amount__c))),
    Payment_Method__c = 'Barter'
    )


//if the payment method field is picklist
AND(
    ISCHANGED( Payment_Amount__c ),
    NOT(ISBLANK(TEXT(Payment_Amount__c))),
    ISPICKVALUE(Payment_Method__c,'Barter')
    )

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com
Nevin O'Regan 16Nevin O'Regan 16
Hi Ajay,

I the Payment_Method__c is picklist field and I have tried your formula but I am getting the below error:

Error: Field Payment_Method__c is a picklist field. Picklist fields are only supported in certain functions.
Soyab HussainSoyab Hussain
Hi Nevin O'Regan,
Try this, maybe this will help you.
AND(
   ISPICKVAL(Payment_Method__c , 'Barter'),
   ISCHANGED(  Previous_Value__c ),
   ISCHANGED(  Payment_Amount__c ) 
)

If you found it useful please appreciate my efforts and mark it as the best answer.

Thanks,
Soyab
This was selected as the best answer
Ajay K DubediAjay K Dubedi
Hi Nevin,

You can try using TEST() method to convert picklist to text. Please try the below syntax - 
 
AND(
    ISCHANGED( Payment_Amount__c ),
    NOT(ISBLANK(TEXT(Payment_Amount__c))),
    TEXT(Payment_Method__c) = 'Barter'
    )

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com
zabee saqibizabee saqibi
Hi Nevin O'Regan,
Can you please put more description (https://www.mskwrites.com/2019/09/urdu-sad-shayari.html)of your issue?
 
Suraj AroraSuraj Arora