This project is read-only.
1
Vote

Issue with retrieving lookup

description

Hello,

I am working on a CRM project and I have a problem to retrieve lookup from Entity Classification DB.

I have to retrieve name, level, and parent classification, which is lookup field.

I am using XrmServiceToolkit.Rest.RetrieveMultiple to retrieve it.

I suppose 'ad_parentclassification' shouldn't be retrieved like this, since it is lookup field, but I don't know how to do it.

Let me know if you need some aditional info.
Thanks in advance

Here is the code sample:
retrieveMultipleRecords = function ()
 {
var accountArray = new Array();
XrmServiceToolkit.Rest.RetrieveMultiple(
    "ad_entityclassificationSet",
    "$select=ad_name, ad_level, ad_parentclassification  &$filter=ad_entityName eq 'account' ",

function (results)
{
    if (results.length >= 1)
    {

        len = results.length;

        for (var i = 0; i < results.length; i++)
        {
            accountArray.push(results[i]);
            acc1[i] = accountArray[i].ad_name;
            lev1[i] = accountArray[i].ad_level;


        }
        max = Math.max(...lev1);
    }
},

function (error)
{
    alert(error.message);
},

function onComplete()
{

},
false);

comments