You need to sign in to do that
Don't have an account?
Gadivemula Krishna
what is prior value in Salesforce and how can we write ispickval and prior value?
I am newbie to Salesforce, I am trying to undertsand the ispickval and prior value. So any insights are helpful to learn for me.
Thank you in Advance
Line 1:- AND( ISNEW() ,Not ISPICKVAL(Account_type__c, 'Register') ):-
Your Record will be new and Account_type__c field value should not be Register
Line 2: AND( ISPICKVAL( PRIORVALUE(Account_type__c),'Register' ) , ISPICKVAL(Account_type__c, 'Gold') )
Account_type__c field previous value 'Register' and Current selected Account_type__c field value 'Gold'
For Example:- Your record have Account_type__c field value 'Register' and now you are trying to Edit this field value to 'Gold' and click on save then Account_type__c field previous value will be Register
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
All Answers
PriorValue() is used to get the previous value of the field and ISPICKVAL() is used to get the value of the picklist field in formula and validation rule.
Please find the below article for the same,
https://www.oreilly.com/library/view/salesforce-advanced-administrator/9781838643898/7fd10169-049f-4492-8582-efd1d8506f7b.xhtml
let me know if you need any further details.
Please mark it as best answer. if this helps
Thanks,
1) Account record can only be created with Register type.
2) One cannot direrctly edit to Register to Gold.
3) It should be traverse from Register to Silver, And then Silver to Gold.
I have tried ths code actually, Its working
OR(
AND( ISNEW() ,Not ISPICKVAL(Account_type__c, 'Register') ),
AND( ISPICKVAL( PRIORVALUE(Account_type__c),'Register' ) , ISPICKVAL(Account_type__c, 'Gold') ) ,
AND( ISPICKVAL( PRIORVALUE(Account_type__c),'Silver' ) , ISPICKVAL(Account_type__c, 'Register') ) ,
AND( ISPICKVAL( PRIORVALUE(Account_type__c),'Gold' ) , ISPICKVAL(Account_type__c, 'Register') ),
AND( ISPICKVAL( PRIORVALUE(Account_type__c),'Gold' ) , ISPICKVAL(Account_type__c, 'Silver') )
)
But i am unable to understand what happening in the code as line to line.
Line 1:- AND( ISNEW() ,Not ISPICKVAL(Account_type__c, 'Register') ):-
Your Record will be new and Account_type__c field value should not be Register
Line 2: AND( ISPICKVAL( PRIORVALUE(Account_type__c),'Register' ) , ISPICKVAL(Account_type__c, 'Gold') )
Account_type__c field previous value 'Register' and Current selected Account_type__c field value 'Gold'
For Example:- Your record have Account_type__c field value 'Register' and now you are trying to Edit this field value to 'Gold' and click on save then Account_type__c field previous value will be Register
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh