I came across this question which was asked in the 'Manufacturing Cloud' Certification.
What are the objects (or) Account forecast objects does not support Triggers in Manufacturing Cloud?
1 Answer
For finding out the Non-Triggerable object list, execute the following code snippet in the anonymous window and get the logs.
Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
List<Schema.DescribeSObjectResult> standardObjDescs = new List<Schema.DescribeSObjectResult>();
for (Schema.SObjectType sobj : gd.values()) {
Schema.DescribeSObjectResult sobjDesc = sobj.getDescribe();
if (!sobjDesc.isCustom()) {
standardObjDescs.add(sobjDesc);
}
}
List<String> triggerableList = new List<String>();
List<String> NOTtriggerableList = new List<String>();
for (Schema.DescribeSObjectResult schemaDesc : standardObjDescs) {
String sobjStruct = JSON.serialize(schemaDesc);
DescribeSobjectResultJSON sobjProps = (DescribeSobjectResultJSON)JSON.deserialize(sobjStruct, DescribeSobjectResultJSON.class);
if (sobjProps.triggerable) {
triggerableList.add(sobjProps.name);
} else {
NOTtriggerableList.add(sobjProps.name);
}
}
NOTtriggerableList.sort();
for (String notTrigble : NOTtriggerableList) {
System.debug(notTrigble);
}
public class DescribeSobjectResultJSON {
public String name {get;set;}
public Boolean triggerable {get;set;}
}
Here are the major Advanced account forecast Objects, that do not support Triggers. Check the objects which start with 'Adv'.
Note: Have referenced the code snippet from the following link, and here sharing the account forecast-level objects only.
For the Code snippets, Credits will go to the actual owner.