You need to sign in to do that
Don't have an account?
Renee Prorok
Need help on custom validation rule upon case creation - current rule causing all cases to fail
I am trying to create a validation rule that stops users from creating a case if they don't fill out a certain picklist field called "Order Type". I only want this validation rule to apply to cases manually created by a user, and not any created by the "system" user, that is the creator of all incooming email2case cases. I put together the rule below, thinking it would work just fine, but had pretty much the opposite effect. Instead of skipping all of the cases created by the system user (005d0000001bgP5), it looked at all those cases and stopped them from being created, since they are auto-created by email2case and we don't have a defalut value for the "Order Type" field established, so that field was always blank and caused this error. Does anyone know why the validation rule is not working as expected and looking at ALL my cases with this record type instead of just the cases NOT created by the user noted in the below rule? Thanks in advance!!
And(CreatedById <> '005d0000001bgP5', RecordTypeId = '012d0000000P8Eu', ISPICKVAL(Order_Type__c,""))
And(CreatedById <> '005d0000001bgP5', RecordTypeId = '012d0000000P8Eu', ISPICKVAL(Order_Type__c,""))
Try below validation rule, let me know if it works.
CreatedById will be null when you are inserting the record, hence you can use the below validation rule.
Here I am checking it with User Id so that it will be always have a value.
Along with it, I would recommend to not to hardcode the values as it will be tough to maintain it in other environments.
Please do let me know if it helps you.
Regards,
Mahesh
I am looking for the "Order Type" field to be required on all cases with the specified record type, except those created by the specific user, and I want the rule to be triggered when the associate first hits "Save" to create the case, not after creation. Any ideas?