You need to sign in to do that
Don't have an account?
Tracey
Testmethods are failing because of Profile Id's in Validation rule
We recently copied across Salesforce production version to our sandbox.
I create some Testmethods for a new trigger that I built but now I'm getting an error on some of the validation rules that use the $User.ProfileId in the validation formulae. This makes sense because the Id will change in different orgs.
What should I be using then. Should I be using $Profile.Name instead of $User.ProfileId in the validation formulae?
Below is a snippet of the error
Error Condition Formula: ($User.ProfileId = "00e20000000mxo7"
||
$User.ProfileId = "00e20000000mxoD"
||
$User.ProfileId = "00e20000000mwku"
||
$User.ProfileId = "00e20000000mxsO" )
&&
ISCHANGED(Description)
&&
NOT(ISPICKVAL (Status , "New"))
Value(s) Found: Status=New , Description=TestDescription2 , $User.ProfileId=00e20000000hFRI
Result: PASS - Continue
Rule Name: Can_not_Edit_Case_Error_Mess_if_Customer
Error Condition Formula: ($User.ProfileId = "00e20000000mxo7"
||
$User.ProfileId = "00e20000000mxoD"
||
$User.ProfileId = "00e20000000mwku"
werewolf
$Profile.Name would probably be a good thing to try, yes.