locked
Run an advanced find on all activities with certain field RRS feed

  • Question

  • I have added a global option set to all activity entites for a sector group. I now want to search against this field in an advanced find.

    I can run the find as in the attached image with one activitiy (E-mail) but as soon as I add the second, I get no records, i.e. the 2 activities are acting like an 'AND'. I can't seem to add the 2 activity related sections as an 'OR'

    Can anyone see where this is going wrong?

    Wednesday, August 8, 2012 1:49 PM

Answers

  • Hi,

    You've worked it out- your advanced find is looking for an activity that is both an email and a meeting, which will never return any results.

    The issue you are facing is that CRM2011 doesn't support adding attributes to the base activity entity and being inherited by sub activities, and in addition, you can't do OR queries accross related entities. If you must have all activities returned in one list, I think the best you can do is adding a plugin that copies your custom field to an out of the box activity attribute and filtering on that. Alternatively, you could create a report to display the activities and hand craft the SQL to do a LEFT OUTER JOIN with an OR clause on the sector field.

    hth,

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"


    Wednesday, August 8, 2012 5:48 PM
    Answerer

All replies

  • Hi Chris,

    I think party equals current user is filtering out your records. try with below.


    Thanks and regards,
    Hiren Solanki.
    Please vote or mark as a answer if it helped you.

    Wednesday, August 8, 2012 2:23 PM
  • Hi Hiren,

    Many thanks for your reply. Unfortunately it didn't work. I have stripped out the section as you mentioned. When I remove the section in the rectangle, the find picks up my test email record. When I add the rectangled section, it picks up no record. I believe its trying to find activities that are both E-mail and Appointments (or E-mail and 121 Meetings the in my second image)

    Many thanks,

    Chris

    Wednesday, August 8, 2012 2:42 PM
  • Hi,

    You've worked it out- your advanced find is looking for an activity that is both an email and a meeting, which will never return any results.

    The issue you are facing is that CRM2011 doesn't support adding attributes to the base activity entity and being inherited by sub activities, and in addition, you can't do OR queries accross related entities. If you must have all activities returned in one list, I think the best you can do is adding a plugin that copies your custom field to an out of the box activity attribute and filtering on that. Alternatively, you could create a report to display the activities and hand craft the SQL to do a LEFT OUTER JOIN with an OR clause on the sector field.

    hth,

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"


    Wednesday, August 8, 2012 5:48 PM
    Answerer
  • Hi Scott,

    Many thanks for your response. I agree that those are the two best answers (if not only answers)

    I think the plugin to be 'correct' solution. It now depends whether the customer thinks its worth my time to develop!

    Many thanks,

    Chris

    Thursday, August 9, 2012 10:11 AM