I have created custom entity called new_property
that has lookup field "Parent Property"since "Property" can be child of another "Property"
I need to determine whether the property has 1 or more children properties or not
for this purpose I did the following
var parentId = Xrm.Page.data.entity.getId();//To get the Id of the Current Entity
var serverUrl = Xrm.Page.context.getClientUrl();
var oDataEndpointUrl = "/XRMServices/2011/OrganizationData.svc/";
//Name of the Entity I am getting Data from
var odataSetName = "new_propertySet";
//The OData Select Statement
var odataSelect = serverUrl + oDataEndpointUrl + odataSetName + "?$select=new_name &$expand=new_ParentProperty($filter=new_propertyId eq guid'" + parentId + "')";
This is throwing a bad request exception
So how should I write my code to accomplish that?
Is "expand" necessary?
These are screenshots formy entity and fields
![]()
![]()
![]()
![]()