locked
Convert lead dialog box RRS feed

  • Question

  • Hi,

    With MS CRM 2011, from the convert lead dialog box, I would like to get the parent window data like objectId of the lead.

    is there a way to access the parent lead form and get some data. Normally the code will be included in the "conv_lead.aspx".

    Thanks for your help.

    Friday, August 19, 2011 9:29 AM

Answers

All replies

  • 1. modify the "convert lead" ribbon button, pass the leadid parameter to the convertLead dialog;

    2.in conv_lead.aspx page, attach window.onload event for your custom code.


    daemon lin
    Friday, August 19, 2011 10:29 AM
  • Hi,

    Why do you want to modify the system web page? it is not recomended and your customizations may fail on upgrading or installing new upgrades and could become a problem. What i will suggest you is the following:

    I woudl suggest you to create in Tab in Lead form i.e. Lead Qualification Additional Details and before Qualifying a Lead show fields to user and force user to fill all additonal details in the lead form qualificaiton tab i..e

    1. Go to Settings->Customization->Customizations->Customize the System->Entities->Lead->Forms , double click on Information Form

    2. Add new tab, section, click on new field button to add new fields (tetx, lookups) for Lead Qualificaiton addiotnald etails

    3. In form customization designer click on the Insert Tab in Ribbon Toolbar, then click on Add Tab button (i.e. you can name it Lead Qualifciation Additional Fields) and place fields into the tab section

    4. Add the following code on On Save Event of Form (if not enter require fields in form then system will force user to enter the fields):

    function FrmOnSave(prmContext) {
    var lclSaveMode;

    if (prmContext != null && prmContext.getEventArgs() != null) {

    lclSaveMode = prmContext.getEventArgs().getSaveMode();

    switch (lclSaveMode) {
    // On Event = Lead Qualificaiton
    case 16:

    // Put all conditions here to check if data is not entered in this field then force user...

    }
    break;

    }
    }
    }

    5. Save and Publish Form

    6. Edit View Columns and Add the new column Case Resolution Detail  

    You may also reffer: http://worldofdynamics.blogspot.com/2011/08/dynamics-crm-2011-perform-jscript.html


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Friday, August 19, 2011 12:28 PM
  • Hi,

    Why do you want to modify the system web page? it is not recomended and your customizations may fail on upgrading or installing new upgrades and could become a problem. What i will suggest you is the following:

    I woudl suggest you to create in Tab in Lead form i.e. Lead Qualification Additional Details and before Qualifying a Lead show fields to user and force user to fill all additonal details in the lead form qualificaiton tab i..e

    1. Go to Settings->Customization->Customizations->Customize the System->Entities->Lead->Forms , double click on Information Form

    2. Add new tab, section, click on new field button to add new fields (tetx, lookups) for Lead Qualificaiton addiotnald etails

    3. In form customization designer click on the Insert Tab in Ribbon Toolbar, then click on Add Tab button (i.e. you can name it Lead Qualifciation Additional Fields) and place fields into the tab section

    4. Add the following code on On Save Event of Form (if not enter require fields in form then system will force user to enter the fields):

    function FrmOnSave(prmContext) {
    var lclSaveMode;

    if (prmContext != null && prmContext.getEventArgs() != null) {

    lclSaveMode = prmContext.getEventArgs().getSaveMode();

    switch (lclSaveMode) {
    // On Event = Lead Qualificaiton
    case 16:

    // Put all conditions here to check if data is not entered in this field then force user...

    }
    break;

    }
    }
    }

    5. Save and Publish Form

    6. Edit View Columns and Add the new column Case Resolution Detail  

    You may also reffer: http://worldofdynamics.blogspot.com/2011/08/dynamics-crm-2011-perform-jscript.html


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

     

    Thanks a lot but this is not what I need , in fact I would like  to get fileds value of parent lead for dialog box  "convert_lead.aspx" , is there  a simpliest way ?  like :

     window.opener.parent.document.Xrm.Page

    or

     window.top.opener.parent.Xrm.Page

     

    Friday, August 19, 2011 1:19 PM
  •  

    could you explain more !

     

      thanks.

    Friday, August 19, 2011 1:21 PM
  • Hi,

    Why are you trying to get Lead form values into the convert_lead.aspx, as per my undertsanding you are trying to execute some JScript code and required to fetch the Lead form values. if you could provide me more details then i can may be offer you a better solution of the problem.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Friday, August 19, 2011 1:42 PM
  • Modifying system .aspx pages are unsupported, which means if anything breaks, you'll get no help from the CRM support team. To that end, I don't believe you have access to the Xrm.Page objects unless you're using a CRM Entity form (though I could be wrong).

    What exactly are you trying to accomplish?

    There are supported ways by which you can recreate the convert_lead.aspx form using a custom CRM Entity that would also allow you easier access to the associated Lead GUID via a M:1 relationship. You can thus easily access ajy and all data on the Lead through REST or (more simply) by mapping fields into a hidden section on the form itself.


    --Dodd
    Friday, August 19, 2011 1:42 PM
  •  

    So, In fact I have a customized attribute in the Lead's form  which is "new_leadtype" (picklist), in the dialog box and based on the value of the lead type I will select automatically the entity type (account, contact or opportunity) and close automatically the dialog box.

    This is whyI should get the "new_leadtype" value of the parent opener window.

     

    Thanks.

    Friday, August 19, 2011 1:49 PM
  • Well, instead of going down Unsupported Avenue, I'd suggest instead using CRM Workflow. If I understand you correctly, the Lead Type field will determine which new entity's will be created? If so, you can override the Convert Lead button's functionality on the ribbon (or create your own), and run code that will create the appropriate records. Or, if you want to take a more simple approach (and save development time), you can have the ribbon button execute a workflow that will create the appropriate record (or combination of records) based on the Lead Type value.

    You really don't want to modify the convert_lead.aspx page.


    --Dodd
    Friday, August 19, 2011 2:37 PM
  • That means that I will re-develop out-of-the-box feature using workflow or whatever ?
    Friday, August 19, 2011 2:48 PM
  • Hi,

    In order to use the supported customization i would suggest you to create a plugin register it on Step QualifyLead on Lead Entity in Pre-Operation record and then update the context paramters as per required (http://msdn.microsoft.com/en-us/library/microsoft.crm.sdk.messages.qualifyleadrequest_members.aspx)

    Although it is unsupported but suits best your scenerio you may try accessing the Lead Form field as mentioned in the following posts: http://bingsoft.wordpress.com/2010/11/18/accessing-the-parent-form-xrm-page-in-crm-2011/

    http://blogs.infinite-x.net/2010/11/18/crm-2011-accessing-the-parent-form-from-a-child-form/


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

    • Proposed as answer by Jehanzeb.Javeed Friday, August 19, 2011 2:59 PM
    • Marked as answer by w.benamor Monday, August 22, 2011 1:46 PM
    Friday, August 19, 2011 2:58 PM
  • Yes.

    Or go unsupported and modify the system pages. Which, on top of wasting your yearly support dollars, you may need to re-implement everytime you apply an Update Rollup as these files are often replaced. I'm discouraging you because I have seen many an unsupported implmentation suffer the consequences of unsupported customization and it can cost a lot more than re-developing a simple Convert Lead form.

    If-- from what you've told me-- the new entity's are determined by the value in a field, and you want this to happen automatically, it actually seems like using workflow (and a customized JScript function called from the ribbon button that would execute the workflow) would actually be easier to create, and would save the users a few clicks. Only downside to workflow is that it's async, and thus, you won't be able to automatically open the newly created records.

    but look, I feel your pain. This is a form that I have consistently nagged about with the CRM Product Team (on their Connect website: https://connect.microsoft.com/dynamicssuggestions/Feedback) as well as the Case Resolution dialog.


    --Dodd
    Friday, August 19, 2011 3:06 PM
  • Hi,

    In order to use the supported customization i would suggest you to create a plugin register it on Step QualifyLead on Lead Entity in Pre-Operation record and then update the context paramters as per required (http://msdn.microsoft.com/en-us/library/microsoft.crm.sdk.messages.qualifyleadrequest_members.aspx)

    Although it is unsupported but suits best your scenerio you may try accessing the Lead Form field as mentioned in the following posts: http://bingsoft.wordpress.com/2010/11/18/accessing-the-parent-form-xrm-page-in-crm-2011/

    http://blogs.infinite-x.net/2010/11/18/crm-2011-accessing-the-parent-form-from-a-child-form/


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

     

    Hello,

    Thanks a lot M. Jehanzeb.Javeed ,

     I found the solution of plugin Step QualifyLead on Lead Entity in Pre-Operation  very appropriate for me.

    Thanks again.

     

     

     

     

     

    Monday, August 22, 2011 1:45 PM