Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

How to filter the results of an oData array

$
0
0

Hi All,

On the quote entity, I have an oData query that returns the records of a custom entity (new_alerts).

"/XRMServices/2011/OrganizationData.svc/new_alertsSet?$select=new_alertsId,new_Alert,new_Message,new_ClientId,new_Category"

I would like to take the GUID from the Potential Customer field (customerid) and select the records that also have that customers GUID held in (new_ClientId). This gives me the GUID of customerid in entityId:

function guidLookup() {
        var entityName, entityId, entityLabel, lookupFieldObject;

        lookupFieldObject = Xrm.Page.data.entity.attributes.get("customerid");
        if (lookupFieldObject.getValue() != null) {
           entityId = lookupFieldObject.getValue()[0].id;
           entityName = lookupFieldObject.getValue()[0].entityType;
           entityLabel = lookupFieldObject.getValue()[0].name;
        }
}

But how would I get the following (results[0].new_ClientId.Id) out of my oData query to use in a comparison?  Bearing in mind I might have many records, i.e. [1], [2], [3], etc. and I would like to search in all of them for the GUID in entityId.

Thanks


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>