May 2019
Intermediate to advanced
546 pages
12h 41m
English
An Apex trigger is created on a Salesforce object where triggers are allowed. Yes, not every object allows triggers. You learned about the object schema in the previous section. You can find that information in the object schema of your object:
Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();Schema.DescribeSObjectResult theObject = gd.get('Account').getDescribe();String sobjStruct = JSON.serialize(theObject);DescribeSobjectResultJSON sobjProps = (DescribeSobjectResultJSON) JSON.deserialize(sobjStruct, DescribeSobjectResultJSON.class);System.debug(sobjProps);// Wrapper with the JSON resultpublic class DescribeSobjectResultJSON { public String name {get;set;} public Boolean triggerable {get;set;}}
Now, check in ...
Read now
Unlock full access