Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

fetchxml is not working and returns null value.

$
0
0

I have a  iframe where the contractors are added and  a list is updated.

After rollup 14 this update to the list is not working.

Please can someone rewrite the fetchxml that's not working.

I get a null value returned for the RetriveMultiEntityRequest(sFetchXml);

" var aoFetchResult = RetriveMultiEntityRequest(sFetchXml);"

***************************

function UpdateOppContractor() {
    var service;
    var orgname = "";
    try {
        // Get the Server URL
        var serverurl = Xrm.Page.context.getServerUrl();
        // If Form Type is CREATE
        if (Xrm.Page.ui.getFormType() == 1) {
            return;
        }
        //define a fetchxml query that returns only the current user.
        var sFetchXml = "<fetch mapping='logical' count='100' version='1.0'><entity name='ascent_teammates'><attribute name='ascent_name' /><order attribute='ascent_name' /><link-entity name='bah_opportunity_ascent_teammates_pc' from='ascent_teammatesid' to='ascent_teammatesid'><filter><condition attribute='opportunityid' operator='eq' value='" + Xrm.Page.data.entity.getId() + "' /></filter></link-entity></entity></fetch>";
        var aoFetchResult = RetriveMultiEntityRequest(sFetchXml);
        var aoOrigResult = aoFetchResult; // HCC Store this for later
        var strTeammateNames = new String();
        var attribs;
        if (aoOrigResult.length == 0) {
            // alert("Missing config record \n\tclaimantid >> "+claimantid);
            //do nothing
        }
        else {
            var i = 0;
            for (a = 0; a < aoFetchResult.length; a++) {
                if (aoFetchResult[a].ascent_name != null) {
                    if (i == 0) {
                        i++;
                        strTeammateNames += aoFetchResult[a].ascent_name;
                    }
                    else {
                        strTeammateNames += "," + aoFetchResult[a].ascent_name;
                    }
                } //end of for loop

                /// For Loop for entity collection
            }  //end of out
            Xrm.Page.getAttribute("hcc_primecontractorlist").setValue(strTeammateNames.substr(0, 4000));
           // Xrm.Page.getAttribute("hcc_primecontractorlist").setSubmitMode("always");
        }
        //HCC CLEAR IT
        if (aoOrigResult.length == 0) {
            Xrm.Page.getAttribute("hcc_primecontractorlist").setValue(null); //HCC Added to clear list if iframe is empty
            //Xrm.Page.getAttribute("hcc_primecontractorlist").setSubmitMode("always");
        }
    }
    catch (e) {
        alert("UpdateOppContractor>>>>> " + e.Description);
    }
}


Viewing all articles
Browse latest Browse all 8223

Trending Articles



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