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
janeisaacjaneisaac 

need formula to determine if value in currency field has been increased

I am stumped at how to even start this one.

 

I have a formula field on a Custom Object that is a child of Account object. This formula determines whether an Approval is required and returns a Yes or No, based on the formula. This is part of an Approval Process.

 

I want to add the criteria that if the Account field "Credit Limit" has been changed and the new number is greater than the prior value this will require District Sales Manager Approval. We do have history tracking on this field.

 

Here is the current formula (without any reference to the criteria I am trying to add).IT is working as expected but I need to add this new piece to it.

 

IF(    

OR(

         Fixed_Price_Customer_Pricing_Records__c > 0,

         Restricted_Price_Level_Customer_Pricing__c > 0,

         ISPICKVAL(Account_Type__c,"04 (net 60 day)"),

         ISPICKVAL(Account_Type__c,"06 (net 80 day)"),

         ISPICKVAL(Account_Type__c,"13 (365 day EQ/Sundry)"),

         ISPICKVAL(Account_Type__c,"Fixed Pricing"),

        Current_Sub_Type__c = "67 Dealers"),

     "Yes",

     "No" )

Best Answer chosen by Admin (Salesforce Developers) 
tquila_andytquila_andy

This is just a suggestion, havnt tried this but may help.

 

"I want to add the criteria that if the Account field "Credit Limit" has been changed and the new number is greater than the prior value this will require District Sales Manager Approval. We do have history tracking on this field."

This could be done with a workflow on the Account object to update a field with a value based on PRIORVALUE(CreditLimit).  

 

1. Create new field LowCreditLimit

2. Create a workflow to update LowCreditLimit if a higher value is entered in credit limit

PRIORVALUE is only available in workflow formula so the change will need to be captured on this event. e.g.

Execution fomula: (PRIORVALUE(CreditLimit)<>CreditLimit) && CreditLimit>PRIORVALUE(CreditLimit))

Update field LowCreditLimitPRIORVALUE(CreditLimit);

 

You can then check the value of the new field in your formula field.  e.g. if Account.CreditLimit>LowCreditLimit then we know the value has been increased.

 

There may be some additional consideration to think of....

 

 

All Answers

tquila_andytquila_andy

This is just a suggestion, havnt tried this but may help.

 

"I want to add the criteria that if the Account field "Credit Limit" has been changed and the new number is greater than the prior value this will require District Sales Manager Approval. We do have history tracking on this field."

This could be done with a workflow on the Account object to update a field with a value based on PRIORVALUE(CreditLimit).  

 

1. Create new field LowCreditLimit

2. Create a workflow to update LowCreditLimit if a higher value is entered in credit limit

PRIORVALUE is only available in workflow formula so the change will need to be captured on this event. e.g.

Execution fomula: (PRIORVALUE(CreditLimit)<>CreditLimit) && CreditLimit>PRIORVALUE(CreditLimit))

Update field LowCreditLimitPRIORVALUE(CreditLimit);

 

You can then check the value of the new field in your formula field.  e.g. if Account.CreditLimit>LowCreditLimit then we know the value has been increased.

 

There may be some additional consideration to think of....

 

 

This was selected as the best answer
janeisaacjaneisaac

Thanks Andy - good idea. I will try it and let you know.

janeisaacjaneisaac

Thanks Andy - that worked like a charm!!