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

how to pass dynamic values to fetch xml using javascript

$
0
0

I want to pass dynamic values to my fetch xml attributes like

var fetchXMLRecords1 = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"+
"<entity name='new_test'>"+
"<attribute name='"+fieldname+"'/>"+  //here i want to pass dynamic values
"<filter type='and'>"+
"<condition attribute='new_policyid' operator='eq' value ='"+Policyid+"' />"+
"</filter>"+
"</entity>"+
"</fetch>";
var fetchRecords1 = XrmServiceToolkit.Soap.Fetch(fetchXMLRecords1);
var fetchlength1= fetchRecords1.length;

am getting the lenght count also

but when i try to retrieve the value like this.. am getting onload undefined error.

var fieldname1=fetchRecords1[i].attributes.["+fieldname+"].value;

Suggest solution for this


Viewing all articles
Browse latest Browse all 55831

Trending Articles