This project has moved and is read-only. For the latest updates, please go here.
1

Closed

Output parameter of type EntityCollection fails when an entity attribute is of type EntityReference

description

Output parameter of type EntityCollection fails when an entity attribute is of type EntityReference. The following lines
        if (valueType == "entityreference") {
            // Gets the lookup object
            var attrValueIdNode = node.childNodes[0];
            var attrValueEntityNode = node.childNodes[2];
            var attrValueNameNode = node.childNodes[3];
should instead be
        if (valueType == "entityreference") {
            // Gets the lookup object
            var attrValueIdNode = node.childNodes[0];
            var attrValueEntityNode = node.childNodes[1];
            var attrValueNameNode = node.childNodes[2];
Closed Jul 31, 2016 at 2:11 AM by Liger_cp <SND\Liger_cp>
Hotfixed into v2.0.1

comments

Liger wrote Jul 31, 2016 at 12:24 AM

Hi, which CRM version are you using?

Liger wrote Jul 31, 2016 at 2:10 AM

Hi, looks like this was an issue with CRM 2013 (they changed the entity reference XML to include an additional node in newer versions).

I've updated this (as well as a few other places) to be more dynamic in case it changes in future as well.

You can download the latest version again which includes this fix.

Thanks for finding this!

wrote Jul 31, 2016 at 2:11 AM