Extensis Logo SUPPORT | FORUMS | KNOWLEDGE BASE

getAssets missing RID


#1

I know I must be doing something stupid, but I am not getting an asset RID when I call getAssets, even if it is specifically stated in assetQueryResultOptions. Let’s say I add “Filename” and “RID”, I only get Filename. If I specify no assetQueryResultOptions, I get everything except RID. Obviously I need the RID to do getAssetPreview later, so I am stuck.

Any ideas?

Thanks!

For the sake of brevity, pretty much the cut down code example for getAssets:

assetQuery aQuery = new assetQuery(); assetQueryResultOptions qResultDetails = new assetQueryResultOptions(); qResultDetails.pageSize = 10; string fNames = "Filename,RID,Keywords"; qResultDetails.fieldNames = fNames.Split(','); assetQueryResults qResults = service.getAssets(sessionId, catalogId, aQuery, qResultDetails); if ( qResults.totalNumberOfAssets > 0 ) { Response.Write("Total Assets found: " + qResults.totalNumberOfAssets +"<br>"); List<asset> resultList = qResults.assets.ToList(); Response.Write(resultList.Count + "<br>"); int count = 0; foreach (asset rItem in resultList ) { List<multiValuedAttribute> oneAsset = rItem.attributes.ToList(); foreach (multiValuedAttribute item in oneAsset) { Response.Write("<br>" + item.name + ": "); List<String> vStrings = item.values.ToList(); foreach (String aString in vStrings) { Response.Write(aString); } } } } else { Response.Write("No records found"); }


#2

Hi,

RIDs are so essential, that we always return them regardless of any options you pass in.

However, they are returned not among the attributes, but at the top level of the asset object as a field named “id”.

Hope that helps!
-Loren


#3

Hi, thanks very much for the reply. assetId it is then…

Still not sure what “RID” in fieldDefinition[] is, because it never holds a value, seemingly. Not that it matters to me much anymore though.