Try our conversational search powered by Generative AI!

Property RelationInfo is always null in Entry


                var catalogSearchParameters =
                    new CatalogSearchParameters
                            JoinType = "Inner Join",
                            JoinSourceTable = "CatalogEntry",
                            JoinTargetQuery = "(Select CatalogEntryId, CatalogNodeId, SortOrder From NodeEntryRelation) NodeEntryRelation",
                            JoinSourceTableKey = "CatalogEntryId",
                            JoinTargetTableKey = "NodeEntryRelation.CatalogEntryId",
                            SqlWhereClause = "NodeEntryRelation.CatalogNodeId=" + preferredCatalogNode.CatalogNodeId,
                            OrderByClause = "NodeEntryRelation.SortOrder DESC"
                var catalogSearchOptions = new CatalogSearchOptions {RecordsToRetrieve = int.MaxValue};
                var catalogEntryResponseGroup = new CatalogEntryResponseGroup(CatalogEntryResponseGroup.ResponseGroup.CatalogEntryFull);
                var entries = CatalogContext.Current.FindItems(catalogSearchParameters, catalogSearchOptions, catalogEntryResponseGroup);


in response i get multiple entries, but RelationInfo property is allways null.

Is that bug or im doing something wrong to get it?


PS. also tried different variations of CatalogEntryResponseGroup flags, did not help either

May 23, 2012 17:33

i need to do this becasue i what to do more 'secondary' sorting in memory, but i cannot do this unless RelationInfo is not null.

May 23, 2012 17:38

What we're trying to accomplish is getting a collection of Entry objects and sort them after their Sort Order property. The RelationInfo property on the Entry objects is always null no mater what. Anybody experienced this before?



May 23, 2012 18:04
int count = 0;
var entries2 = CatalogContext.Current.FindItemsDto(catalogSearchParameters, catalogSearchOptions, ref count, catalogEntryResponseGroup);


    if i use this code then i can get entries2.NodeEntryRelation[0].SortOrder, but i would like to get the same data without using Dto method call

May 23, 2012 18:17

I you are only trying to get the entries in order of the catalog node you could do the following.

CatalogRelationResponseGroup group = new CatalogRelationResponseGroup(CatalogRelationResponseGroup.ResponseGroup.NodeEntry);
CatalogRelationDto relation = CatalogContext.Current.GetCatalogRelationDto(0, nodeId, 0, "", group);
var entries = CatalogContext.Current.GetCatalogEntries(relation.NodeEntryRelation.AsEmuerable().Select(row => row.CatalogEntryId).ToArray());


You could also could convert the dto to an Entry[] by

.Select(row => new Entry(row))


May 24, 2012 22:20

SortOrder is available here:

var relationInfos = entries2.NodeEntryRelation;


but after doing this:

var entries = entries2.CatalogEntry.AsEnumerable().Select(row => new Entry(row)).ToList();


entries has RealtionInfo null, i suposse becasue only catalogEntryRow is passed to constructor


but your idea got me to this solution:

var query = from entry in entries2.CatalogEntry.AsEnumerable()
            join rel in entries2.NodeEntryRelation.AsEnumerable() on entry.CatalogEntryId equals rel.CatalogEntryId
            select new Entry(entry) { RelationInfo = new RelationInfo { SortOrder = rel.SortOrder } };


so then i suppose answer to my question: if i can get RelationInfo without calling Dto method(just by calling FindItems) is 'false'

May 25, 2012 8:57

No, becasue you need the full dto to be able to populate the RelationInfo.  Although if you put a repsonse group of relations or full it should pouplate the relation info.  I will take a look at that and pass on to development.

Is strange the relationinfo is not populating when passing in the row constructor, as it looks to see if there is a RelationTypeId in the table.  It does not matter that it passes just row in because it can get the related tables for the row as it does with Inventory etc.  Anyway I will dig a little deeper and get back to you  

May 25, 2012 23:38
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.