locked
Activity > Convert to - Code RRS feed

  • Question

  • I was trying to find out a way to find the properties of this "activity". The menu bar at the top, to which i cannot find the code of what it does, is where i need to change.

    http://i64.photobucket.com/albums/h198/boris37/CRM01.jpg

    Basically i want to add a remove functionality to this button but i have no idea how to get to this buttons onevent or whatever CRM built with it.

    I am new to CRM and have no idea other then "customization" to find any of this stuff and i can't currently fine it in there.

    Any help would be nice.
    Tuesday, January 5, 2010 4:24 PM

Answers

  • In the case of "Convert to Case", the only association between the email and the new case is this: title of case will be the same as subject of the email;  Regarding of the email will be changed to the case.  So if you still want to do this via Plugin, then you can write a post-plugin, allocate the email record using above relations, and pull data from the email record into the case record.  The down side of this approach is that it will be firing off on every new case creation, and always try to look for an associated email, thus creates unnecessary overhead.
    • Proposed as answer by James Chao Wednesday, January 6, 2010 8:21 PM
    • Marked as answer by boris37 Tuesday, January 12, 2010 4:53 PM
    Wednesday, January 6, 2010 8:21 PM

All replies

  • you have to modify hte isv.config file to add buttons to the toolbar. check this link.
    http://msdn.microsoft.com/en-us/library/bb928136.aspx
    Tuesday, January 5, 2010 4:33 PM
  • if you want to just hide or remove these buttons then you just need to write simple javascript code (as follows) and put this under Email Form On Load code in CRM..(make sure you enable the event)

    //this lines removes  Convert to Opportunity Option  (i.e. meaning hiding it from screen)

    if (document.getElementById('toOpportunity') != null)

    {

    document.getElementById('toOpportunity').parentNode.removeChild(document.getElementById('toOpportunity'));

    }

     

    //this lines removes  Convert to Lead Option  (i.e. meaning hiding it from screen)

    if (document.getElementById('toLead') != null)

    {

    document.getElementById('toLead').parentNode.removeChild(document.getElementById('toLead'));

    }

    Tuesday, January 5, 2010 4:56 PM
  • all of these are very helpful but not what i need.

    I need to change the event that fires. It brings up a /act_dlgs/convert_to_case.aspx

    I check the file and it does basically nothing except a few returns... unless i'm blind.

    I basically need to find what this runs, what information it pulls out of the activity and what it throws into the case.

    This is all so i can get the "body" of the e-mail, parse out all the HTML and throw it into case "Description" attribute.

    Sorry if it's confusing i am trying to figure out how to do all of this.
    Tuesday, January 5, 2010 5:05 PM
  • I think in this case why don't you write a plugin on the incident(case) entity.
    I hope you are introduct to MS CRM Plugins. (If not you can get more info on plugin in MS CRM sdk)
    You have to register this plugin on the child pipeline.
    You can reterive the body of hte email using the MS CRM sdk and update the description field of the incident entity.
    here is an example of child pipeline.
    http://msdn.microsoft.com/en-us/library/cc151083.aspx
    for introduction to plugin, see this.
    http://msdn.microsoft.com/en-us/library/dd393303.aspx
    • Marked as answer by boris37 Tuesday, January 5, 2010 6:14 PM
    • Unmarked as answer by boris37 Tuesday, January 5, 2010 11:52 PM
    Tuesday, January 5, 2010 5:35 PM
  • Yeah i can write a plugin for sure it won't be a big deal.

    I have a CRM programming book it just doesn't tell me where to stick this stuff(which is why i come on here).

    Would this be the easiest way? Seems like a little overkill(maybe because i have never written a plugin).


    My only question about the plugin would be that the child parent would track all the info in the e-mail and then send it to the incident when the e-mail is closed right? Would i add this info to the convert to case aspx?

    Tuesday, January 5, 2010 6:01 PM
  • i am not sure but i think if you write a pre-plugin you will get this information.
    I think you write a child plugin and register it against the case and use the debugger to find which properties are available to you in the context object.
    Tuesday, January 5, 2010 6:10 PM
  • what message would you be listening for?  There is no "Convert activity to opportunity" message.  On the create opportunity?  How would you know what the source activity (email) was?
    Tuesday, January 5, 2010 10:02 PM
  • mardukes is right.  Your only option will be create a custom aspx page to do the "Convert to Case" action.  The out of box feature doesn't really pull any field into the Case record except associating the activity to the new Case.  
    Wednesday, January 6, 2010 7:14 AM
  • Well that would be fine i only need an association. If i can even see that association i am mostly there.

    Would this "association" not be adequate to get the required field?

    Sorry i am a little confused, it... "Should" work right?

    Would the plugin basically check "if association exists on create then get e-mail.body and populate case.descriptionfield" ??? or am i thinking wrong.
    Wednesday, January 6, 2010 4:18 PM
  • In the case of "Convert to Case", the only association between the email and the new case is this: title of case will be the same as subject of the email;  Regarding of the email will be changed to the case.  So if you still want to do this via Plugin, then you can write a post-plugin, allocate the email record using above relations, and pull data from the email record into the case record.  The down side of this approach is that it will be firing off on every new case creation, and always try to look for an associated email, thus creates unnecessary overhead.
    • Proposed as answer by James Chao Wednesday, January 6, 2010 8:21 PM
    • Marked as answer by boris37 Tuesday, January 12, 2010 4:53 PM
    Wednesday, January 6, 2010 8:21 PM
  • Did you get this plugin to work? I'm trying to to the same, just for the converting email to opportunity. But somehow I cannot find the e-mail associated with the newly created opportunity.
    Wednesday, January 27, 2010 9:34 AM