0

I came across this question which was asked in the 'Manufacturing Cloud' Certification.

1 Answer 1

0

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'.

enter image description here

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.

Which standard objects don't support triggers?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .