I have a problem with setting up a cross object validation rule.
I have two custom objects, one caled "Client" and the other "Interventions". "Client is the master object and "Interventions" is the child. Each has multiple Record Types available to users. All Interventions must be linked to a Client.
I am trying to create a validation rule under teh "Interventions" object to ensure that a particular Intervention Record Type can only be used with any Client that is of a particular Record Type.
I enclose a copy of what I have done below which triggers whether I pick a client is or is not of the Client Record Type specified. Hopefully it is something obvious I am doing wrong ! All help gratefully apreciated. See below for what I have done (no errors returned on saving this rule).
AND( NOT( $ObjectType.X_Client_c__c.Fields.RecordTypeId = "012C0000000QFq4"), RecordTypeId = "012C0000000QFqJ")
I have also tried a variant of the above picking up a field from the Client containing the client name (a text field) for very specific mapping of the rule but this has the same problem.
Best regards
Noel
3 个回答
Hi Noel,
It may be easier to create a formula on your Intervention object to get the parent record type.
1. Create text formula on Intervention to capture the client record type (use the advanced formula editor, insert field and navigate to what you need).
2. Create validation rule on the Intervention object along the lines of this:
AND(Client Record Type Formula = "Client Record Type Name", $RecordType.Name = "Intervention Record Type Name")
...if the names sync up you can simplify:
Client Record Type Formula <> TEXT($RecordType.Name)
Please let me know if this helps!
Dan Boudreau