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
bathybathy 

Opportunity Stage update

Hi All,

I have created a validation rule to ensure the users update notes(custom text area field) every time they change the opportunity stage.

And( ISCHANGED( StageName ) , Not(ISCHANGED( Notes2__c ) )) this is the formula.This works fine. But my Salesforce users want to update the notes with minimum 20 characters which I tried using another validation rule  with the formual AND(ISCHANGED( StageName ), if(len( Notes2__c )<(len(Priorvalue(Notes2__c))+20),true,false)) but it is not working as expected.

system is going into loop and asking the user to update the notes even though they entered more than 20 characters.

Please advise any other way of achieving this.
thanks in advance
Best Answer chosen by bathy
Vatsal KothariVatsal Kothari
Hi Bathy,
IF(AND(ISCHANGED( StageName ),len( Notes2__c ) < (len(Priorvalue(Notes2__c))+20)) , true, false)
//Above formula will check length of the notes with previous notes length + 20 character

IF(AND(ISCHANGED( StageName ),len( Notes2__c ) < 20) , true, false)
//Above formula will check length of the notes with 20 character

you can use any of the formula as per your requirement.

If this solves your problem, kindly mark it as the best answer.

Thanks,
Vatsal

All Answers

Vatsal KothariVatsal Kothari
Hi Bathy,
IF(AND(ISCHANGED( StageName ),len( Notes2__c ) < (len(Priorvalue(Notes2__c))+20)) , true, false)
//Above formula will check length of the notes with previous notes length + 20 character

IF(AND(ISCHANGED( StageName ),len( Notes2__c ) < 20) , true, false)
//Above formula will check length of the notes with 20 character

you can use any of the formula as per your requirement.

If this solves your problem, kindly mark it as the best answer.

Thanks,
Vatsal
This was selected as the best answer
logontokartiklogontokartik
You can write all in one validation rule instead of two. Try the below

OR(IF(AND(ISCHANGED(StageName),NOT(ISCHANGED(Notes2__c))),true,false),
   IF(AND(ISCHANGED(StageName),ISCHANGED(Notes__c),(LEN(Notes2__c)<20)),true,false))


bathybathy
thanks for your replies guys. both formulas are woking.  But I prefer VatsalKothari's Formula.