2
votes

I need to get all guids in an Entity by using Javascript crm 2011?for Ex:I have the Entity called Contact.In that contact Entity ther is an 5000 records.I need to get alll 5000 guid in a Javacript .

How to do this?

2

2 Answers

2
votes

OData is limited to 50 records. To Retrive more than 50 records we have to use Paging kindly check this RetrieveRecords

0
votes

For a "bulk Get" you can try This solution

To get just one guid, you can use Web Resources(Simple HTML page).

<!DOCTYPE html>
<html>
<head>
<script>
function RetreiveGuid() 
{
    var guid = window.parent.Xrm.Page.data.entity.getId();
    var cleanGuid =guid.replace(/{/g,"").replace(/}/g,"");
    var entityName = window.parent.Xrm.Page.data.entity.getEntityName();
    document.getElementById("demo").innerHTML = entityName + " : " + cleanGuid;
}
</script>
</head>

<body>

<h4>Using Web Resources to Get Guid</h4>

<p id="demo"></p>

<button type="button" onclick="RetreiveGuid()">Get Guid</button>

</body>
</html>