Update Activity Assocative View

 

function

 

 

 

 

filterActivityGrid() {

 

 

 

var navActivity = document.getElementById(‘navActivities’);

 

 

 

if (navActivity != null && navActivity != undefined) {

 

navActivity.onclick =

 

 

function () {

 

loadArea(

 

 

‘areaActivities’);

 

 

 

 

 

var iframe = document.getElementById(‘areaActivitiesFrame’);

 

iframe.onreadystatechange =

 

 

function () {

 

 

 

if (iframe.readyState == “complete”) {

 

 

 

var iframeDoc = iframe.contentWindow.document;

 

 

 

var picklist = iframeDoc.getElementById(‘crmGrid_Contact_ActivityPointers_scheduledend’);

 

 

 

//alert(picklist);


 

 

var option = document.createElement(‘option’);

 

option.text =

 

 

‘opportunity Activities’;

 

option.value =

 

 

‘opportunity’;

 

picklist.add(option);

 

picklist.onchange =

 

 

function () {

 

 

 

var contactid = Xrm.Page.data.entity.getId();

 

 

 

var g = iframeDoc.getElementById(‘crmGrid_Contact_ActivityPointers’).control;

 

 

 

if (picklist.value == ‘opportunity’) {

 

 

 

var b = “<fetch distinct=’false’ no-lock=’false’ mapping=’logical’>” +

 

 

 

“<entity name=’activitypointer’>” +

 

 

 

“<attribute name=’regardingobjectid’ />” +

 

 

 

“<attribute name=’activitytypecode’ />” +

 

 

 

“<attribute name=’prioritycode’ />” +

 

 

 

“<attribute name=’ownerid’ />” +

 

 

 

“<attribute name=’createdby’ />” +

 

 

 

“<attribute name=’subject’ />” +

 

 

 

“<attribute name=’scheduledend’ />” +

 

 

 

“<attribute name=’statecode’ />” +

 

 

 

“<attribute name=’activityid’ />” +

 

 

 

“<order attribute=’subject’ />” +

 

 

 

“<link-entity name=’opportunity’ from=’opportunityid’ to=’regardingobjectid’ link-type=’inner’>” +

 

 

 

“<link-entity name=’contact’ from=’contactid’ to=’new_primarycontactid’>” +

 

 

 

“<filter>” +

 

 

 

“<condition attribute=’contactid’ operator=’eq’ value=’” + contactid + “‘ />” +

 

 

 

“</filter>” +

 

 

 

“</link-entity>” +

 

 

 

“</link-entity>” +

 

 

 

“</entity>” +

 

 

 

“</fetch>”;

 

g.setParameter(

 

 

“fetchXml”, b);

 

g.refresh();

 

}

 

 

 

else {

 

loadArea(

 

 

‘areaActivities’);

 

g.setParameter(

 

 

“fetchXml”, );

 

g.setParameter(

 

 

“fetchXmlForFilters”, g.getParameter(“fetchXmlForFilters”));

 

g.refresh();

 

}

 

};

 

 

picklist.value =

 

 

‘opportunity’;

 

onloadgrid(iframeDoc);

 

}

 

}

 

};

 

}

 

}

 

function

 

 

 

 

onloadgrid(iframeDoc) {

 

 

 

var contactid = Xrm.Page.data.entity.getId();

 

 

 

var g = iframeDoc.getElementById(‘crmGrid_Contact_ActivityPointers’).control;

 

 

 

var b = “<fetch version=’1.0′ output-format=’xml-platform’ mapping=’logical’>” +

 

 

 

“<entity name=’activitypointer’>” +

 

 

 

“<attribute name=’activitytypecode’ />” +

 

 

 

“<attribute name=’prioritycode’ />” +

 

 

 

“<attribute name=’ownerid’ />” +

 

 

 

“<attribute name=’createdby’ />” +

 

 

 

“<attribute name=’subject’ />” +

 

 

 

“<attribute name=’scheduledend’ />” +

 

 

 

“<attribute name=’statecode’ />” +

 

 

 

“<attribute name=’activityid’ />” +

 

 

 

“<order attribute=’subject’ />” +

 

 

 

“<filter type=’or’>” +

 

 

 

“<condition attribute=’statecode’ operator=’eq’ value=’0′ />” +

 

 

 

“<condition attribute=’statecode’ operator=’eq’ value=’3′ />” +

 

 

 

“</filter>” +

 

 

 

“<link-entity name=’opportunity’ from=’opportunityid’ to=’regardingobjectid’ link-type=’inner’>” +

 

 

 

“<filter>” +

 

 

 

“<condition attribute=’new_primarycontactid’ operator=’eq’ value=’” + contactid + “‘ />” +

 

 

 

“</filter>” +

 

 

 

“</link-entity>” +

 

 

 

“</entity>” +

 

 

 

“</fetch>”;

 

 

 

g.setParameter(

 

 

“fetchXml”, b);

 

g.refresh();

 

}

 

This entry was posted in MS Dynamic CRM 2011. Bookmark the permalink.

11 Responses to Update Activity Assocative View

  1. pregnancy says:

    What would we all do without the presence of the excellent suggestions you talk about on this site? Who else comes with the tolerance to deal with essential topics in the interests of common subscribers like me? I actually and my pals are very delighted to have your blog among the ones we frequently visit. It is hoped you know how much we appreciate your working hard! Best wishes from us all.

  2. We so appreciate your site post. There are hundreds of tactics we could put it to great use by means of minimal effort in time and capital. Thank you really with regard to helping make the post respond to many questions we have had before now.

  3. I won’t be able to thank you sufficiently for the content on your web site. I know you’d put a lot of time and effort into all of them and really hope you know how deeply I appreciate it. I hope I’ll do the same for someone else sooner or later.

  4. It was a pleasure discovering your site last night. I came here just now hoping to find out new things. I was not upset. Your ideas upon new solutions on this topic were insightful and a good help to me. Thank you for creating time to create these things as well as sharing your thinking.

  5. micro nichos says:

    All I can state is, I am not sure what to express! Except naturally, for the excellent tips which are shared on this blog. I can think of a thousand fun ways to read the reports on this site. I do believe I will ultimately take action making use of your tips on those issues I could never have been able to handle alone. You had been so thoughtful to permit me to be one of those to benefit from your useful information. Please know how great I enjoy the whole thing.

  6. It can be rare to get an experienced person in whom you will surely have some confidence. In the world at present, nobody definitely cares about showing others exactly how in this subjecttopic. How lucky I am to have now found a really wonderful website as this. It really is people like you who make a genuine difference currently through the thoughts they share.

  7. I couldn’t have really asked for a better blog. You’re ever present to offer excellent advice, going instantly to the point for straightforward understanding of your readership. You’re really a terrific professional in this matter. Thank you for currently being there for folks like me.

  8. mojibakeru says:

    I am unable to thank you adequately for the discussions on your web site. I know you add a lot of time and effort into them and truly hope you know how considerably I enjoy it. I hope I can do a similar thing for someone else at some time.

  9. What would most people do without the presence of the magnificent ideas you discuss on this web site? Who has the persistence to deal with critical topics in the interest of common readers like me? My partner and i and my girlfriends are very lucky to have your site among the ones we generally visit. It is hoped you know how a great deal we get pleasure from your work! Best wishes coming from us all.

  10. It was a excitement discovering your site yesterday. I came here just now hoping to get something new. I was not dissatisfied. Your ideas about new tactics on this subject matter were helpful and a wonderful help to my family. Thank you for leaving out time to write down these things and then for sharing your ideas.

  11. The ideas you shared here are very priceless. It was such an entertaining surprise to see that awaiting me after i woke up today. They are always to the point as well as simple to learn. Thank you so much for the useful ideas you have shared here.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>