4

I need to find that if selected sObject has included "Notes and Attachment". Is it possible through sObject Describe?

I need to filter all sObject in organisation by availability of "Notes and Attachment" in it or we can say filtering sObjects by notes and attachment support on it. Please provide some solution about how it can be possible? By which criteria we can find that sObject has "Notes and Attachment" support. Is it possible from Describe on sObject?

Here I need to iterate all the objects and describe limit is 100. So some good approach will require.

1

I think you can use getChildRelationships() which returns a list of Schema.ChildRelationship then check if the Attachment is in the list, here is an example for Case :

for(Schema.ChildRelationship s : Case.sObjectType.getDescribe().getChildRelationships())
{
    System.debug('+-------------$ Object type = '+s.getChildSObject());
    System.debug('+-------------$ Relationship Name = '+s.getRelationshipName ());
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.