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

FetchXml in Javascript to count members in "Dynamic" marketing list

$
0
0

Hello Experts,

I want to count members in dynamic marketing list through fetchXml in javascript.

I have used following code, but i don;t know how to get count further. I used "membercount" for static marketing list. But or dynamic marketing list, pls help.

Any help in welcome.

function putdata()
{
var orgService;
var orgName="Training";
var servercontext=Xrm.Page.context;
var serverUrl=servercontext.getServerUrl();
var EntityName="contact";
var inputXml="<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>"+
"<entity name='list'>"+
"<attribute name='listname' />"+
"<attribute name='type' />"+
"<attribute name='createdfromcode'/>"+
"<attribute name='lastusedon'/>"+
"<attribute name='purpose' />"+
"<attribute name='listid'/>"+
"<order attribute='listname' descending='true' />"+
"<filter type='and'>"+
"<condition attribute='purpose' operator='not-null' />"+
"</filter>"+
"<link-entity name='listmember' from='listid' to='listid' visible='false' intersect='true'>"+
" <link-entity name='"+EntityName+"' from='"+EntityName+"id"+"' to='entityid' alias='af'></link-entity>"+
"</link-entity>"+
"</entity>"+
"</fetch>";
alert("hello");
orgService=new FetchUtil(orgName,serverUrl);
alert("world");
orgService.Fetch(inputXml,myCallBack);
};
function myCallBack(results)
{
debugger;
var sOut = "";
sOut += "XML Response";
sOut += results;
alert(results[0].attributes["purpose"].value);

????

};

Thanks in Advance,

Tanu Goyal.


Viewing all articles
Browse latest Browse all 82002

Trending Articles