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 Answer 1

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 ());
}

You must log in to answer this question.

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