I want the parent structure for a portfolio using API. Is anything existing?
Looking something like Parent1ID/Parent2id/.../Parent5id/Portfolioid
I don't want to loop for each parent to get the parentid as it will hit performance issue.
Thanks in advance,
There is not a way to do this without looping. You will either need to walk the hierarchy up from the leaf Portfolio Items. Or work down from the top by fetching the Children collections of the Portfolio Items.
To help some, you may set the fetch parameter to be only what you need so you are not returning the whole Artifact for example:
Michael is correct. There isn't a way to do this without "looping".
It's not exactly a loop but it's a recursive call. You will need to find the parent's parent, then the parent of that parent etc..
The reason is that the information of the entire ancestry path is not stored on any given object. It needs to be constructed using this type of recursive call.