2

The FeedItem object is used in my Org. There is a field called parent ID. But i am not being able to understand to which object is FeedItem related to? is there a way to see which object is parent id referring to in my org?

3

When you have a reference of type ID (such as your FeedItem parent ID) you can directly get the type token of the object (in this case the parent object) and add whatever dependent logic you need:

Id parentId = ...;
SObjectType sobType = parentId.getSObjectType();

if (sobType == Contact.SObjectType) {
    ...
}

That logic can use hard-coded types as above or can make use of describe calls to find out the relevant information.

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.