Hello,
I am using CRMRestKit and want to determine in front-end code number of child entities having a given parentid.
Example, entity A and B have 1:N relationship.
I have GUID of entity A and now need to find how many records of B are related to the GUID of A.
I searched and tried many things, but i am still unable to get it to work.
Here is my best shot :
var filter = "new_childPrimaryId/new_parentPrimartId eq 'Guid(" + knownParentGuid + ")' ";
CrmRestKit.ByQuery('new_childSchemaName', [], filter, false). then(function (data, status, xhr) { //alert("results are" + data.d.results); var details = data.d.results; }, function (xhr, status, errorThrown) { } );
new_childPrimaryId = "Name" of feild of child entity, not the 'schema name' or 'display name'.
new_parentPrimartId = lookup field name of parent in child entity. Again, it is the "Name" of the lookup
The solution lies somewhere in a correct filter.
Thanks