0

I'm triying to retrieve a ClassDescription symbolicName of an IDocument object. It seems that i have to fetch its ClassDescription even if I just want the symbolicName.

Is there a way to do it ? I just want to avoid doing a fetch for every browsed document...

(Also IDocument.GetClassName doesn't help, it returns "Document")

ᄂ ᄀ
  • 5,669
  • 6
  • 43
  • 57
Amessihel
  • 5,891
  • 3
  • 16
  • 40

2 Answers2

0

I finally found a way, by making an SQL SELECT request retrieving the classDescription ID (which is not the symbolicName ID, but rather an "internal" one) :

Select This, d.Id, d.ClassDescription
From Document d
where d.Id = ID

It seems to be lighter than a line like document.fetch(classDescription) (pseudo call) cause it should just retrieves the ID.

Amessihel
  • 5,891
  • 3
  • 16
  • 40
0

I thought it worth mentioning a problem regarding the accepted answer.

There are times that doing a query would be "lighter" however I believe you are missing something involving fetching a document.

FileNet's fetchInstance command can take in a PropertyFilter. In your case you could do something along the lines of:

PropertyFilter pf = new PropertyFilter();
pf.AddIncludeProperty(new FilterElement(null, null, null, "ClassDescription", null));
doc = Factory.Document.FetchInstance(os, new Id("doc.ID()"), pf);

You would probably want to look at your original fetch of this document and make sure to specify the full list of property filters at that point.

See Working With Documents

Community
  • 1
  • 1
  • Indeed. Actually I didn't want to perform fetch operations in addition to an SQL request, in order to minimize server calls. I only want fetch properties, ideally in a one-shot, when it's needed (with PropertyFilter as you mentionned it ; I admit it can be an extreme point of view). – Amessihel Jan 28 '16 at 11:00