Hii everyone.
I am trying to pass an dynamic value to an fetchXMLQuery.
Code:-
function ShopOnLoad()
{
alert("Function approached");
string dynamic = "Brand Factory";
string shopFetchXML =@"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='new_myshopping'>
<attribute name='new_myshoppingid'/> "
<attribute name='new_shoppingname'/>
<attribute name='new_finalamount'/>
<attribute name='createdon'/>
<order attribute='new_shoppingname' descending='false'/>
<filter type='and'>
<condition attribute='new_shoppingname' operator='eq' value='"+dynamic+@"'/>
</filter>
</entity>
</fetch>" ;
alert("XMLFetch Query Executed");
var shopRecords = XrmServiceToolkit.Soap.Fetch(shopFetchXML);
alert("Multiple data fetched");
if(shopRecords.length > 0 && shopRecords[0].attributes.new_finalamount != undefined)
{
alert("If Condition approached");
alert(shopRecords[0].attributes.new_finalamount.value);
alert(shopRecords[0].attributes.new_shoppingname.value);
}
alert("Finished");
}
I am getting an error of ShopOnLoad is not defined at eval.
I have used all related Web Resources.
*This post is locked for comments