0

Trying to create formula like :

AND( 
RecordType.DeveloperName = 'recType' ,
ISCHANGED(AccountId),
Product_Cnt__c<>0,
OR(
AND(
ISPICKVAL(PRIORVALUE(Account.BillingCountry),Account.BillingCountry), 
NOT(ISPICKVAL(Account.BillingCountry,Account.BillingCountry))
),
AND(
ISPICKVAL(PRIORVALUE(Account.BillingCountry),Account.BillingCountry), 
NOT(ISPICKVAL(Account.BillingCountry,Account.BillingCountry)))
)
)

However unable to save and getting The PRIORVALUE function cannot reference the Account.BillingCountry field. Unable to use ischanged(Account.BillingCountry)

  • 1
    You cannot use ISCHANGED and PRIORVALUE with relation fields. Can you explain what are you trying to achieve? – rahul gawale Dec 3 '19 at 1:31
  • Trying to check if opportunity related account billing country is not same as previously present. – sfdc-neta Dec 3 '19 at 1:32
  • 1
    do you want to allow account change if country is the same, and fire validation if country of the new account is different than the previous one? – rahul gawale Dec 3 '19 at 2:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.