You need to sign in to do that
Don't have an account?
Giancarlo Amati
Validation Rules $Object
Hi Everyone,
I am currently reviewing the validation rules on opportunities. I've found the following lines, which I'd like to understand. Within the context of a validation rule which triggers the error only when the rule is True, what does these formulas do? Do they related to "Related Lists" child objects of the opportunity?
Thank you.
NOT(ISBLANK($ObjectType.Live_Event_Coverage__c.Fields.Live_Event_Allotment_Opportunity__c)), /*allows Live Events to process*/
NOT(ISBLANK($ObjectType.SE_Customer_Solution__c.Fields.Opportunity__c )), /*allows SE Customer Solutions to process*/
NOT(ISBLANK( $ObjectType.Live_Event_Coverage_Timing__c.Fields.CoverageLink__c)), /*allows Live Event Timings to process*/
I am currently reviewing the validation rules on opportunities. I've found the following lines, which I'd like to understand. Within the context of a validation rule which triggers the error only when the rule is True, what does these formulas do? Do they related to "Related Lists" child objects of the opportunity?
Thank you.
NOT(ISBLANK($ObjectType.Live_Event_Coverage__c.Fields.Live_Event_Allotment_Opportunity__c)), /*allows Live Events to process*/
NOT(ISBLANK($ObjectType.SE_Customer_Solution__c.Fields.Opportunity__c )), /*allows SE Customer Solutions to process*/
NOT(ISBLANK( $ObjectType.Live_Event_Coverage_Timing__c.Fields.CoverageLink__c)), /*allows Live Event Timings to process*/
So line 1 - is looking at the Live_Event_Coverage__c field for the record and then looking at the field on that record Live_Event_Allotment_Opportunity__c to ensure it is not blank.
Similarly the other lines are checking across other related records to check fields on those records.
It is another way of saying : NOT(ISBLANK(Live_Event_Coverage__r.Live_Event_Allotment_Opportunity__c))
Regards
Andrew
All Answers
So line 1 - is looking at the Live_Event_Coverage__c field for the record and then looking at the field on that record Live_Event_Allotment_Opportunity__c to ensure it is not blank.
Similarly the other lines are checking across other related records to check fields on those records.
It is another way of saying : NOT(ISBLANK(Live_Event_Coverage__r.Live_Event_Allotment_Opportunity__c))
Regards
Andrew
Help file which casts not a lot of light:
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_global_objecttype.htm
Generally you use the $ObjectType variables when you want to grab things like labels for fields, so it's more for meta-data, but they can return field values also.
Regards
Andrew
g