locked
Customiza close opportunity dialog box RRS feed

  • Question

  • Hello all,

    i am working on crm 4.0.

    i have customized the close opportunity dialog box by putting one checkbox.

    plz look at this image

    now i want to use this checkbox result in visual studio by fetching it from database or other way

    or in plugin that invoke after opportunity closed as won.

    how can i do it???

    my customization code for that checkbox in "C:\Program Files\Microsoft Dynamics CRM\CRMWeb\SFA\opps\dlg_closeopp.aspx" this file is as below

    <tr>
    <td>
    <label>Do you Want to create Project?</label>
    </td>
    <td>
    <input class="checkbox" type="checkbox" id="checkedProject" onclick="projectChecked();">
    </td>

    please give me possible solution.


    Kartik Ghodasara Associative Software engineer, Synoverge Tech Pvt. Ltd. Ahmedabad




    Wednesday, July 18, 2012 10:22 AM

Answers

  • Hi Kartik,

    customizing the aspx-files is not a real good idea, cause of updates overwriting your changes...
    In Addition, you cannot access these checkboxes in plugin code.

    What you should do is:

    • Create a new Button in the top Form-Menu via isv.config
    • write a javascript, that creates your project via soap-calls

    This way you have a solution which will not get touched when installing updates and you cannot forget to create a project while closing the opportunity.

    What you also could do is:

    • Modify the Win-Opportunity-Button via form-onload-script by setting a new onclick-function
    • in this function open the win-opportunity-form
    • when the user closes the win-opportunity-form by hitting "OK", ask (javascript confirm) if you should create a project
    • if user clicked yes, create the project via soap-calls

    Hope that helps

    Thomas Rehm

    Wednesday, July 18, 2012 10:51 AM

All replies

  • What exactly you are trying to achieve with this customization?

    Piyush

    Wednesday, July 18, 2012 10:30 AM
  • Hi Kartik,

    customizing the aspx-files is not a real good idea, cause of updates overwriting your changes...
    In Addition, you cannot access these checkboxes in plugin code.

    What you should do is:

    • Create a new Button in the top Form-Menu via isv.config
    • write a javascript, that creates your project via soap-calls

    This way you have a solution which will not get touched when installing updates and you cannot forget to create a project while closing the opportunity.

    What you also could do is:

    • Modify the Win-Opportunity-Button via form-onload-script by setting a new onclick-function
    • in this function open the win-opportunity-form
    • when the user closes the win-opportunity-form by hitting "OK", ask (javascript confirm) if you should create a project
    • if user clicked yes, create the project via soap-calls

    Hope that helps

    Thomas Rehm

    Wednesday, July 18, 2012 10:51 AM
  • hi piyush 

    thanks for reply

    i have created plugin which create project in project server after opportunity closed as won.

    now i want to put one condition in the close opportunity dialog box that user want to create project or not.

    for that reason i want the checkbox result.


    Kartik Ghodasara Associative Software engineer, Synoverge Tech Pvt. Ltd. Ahmedabad

    Wednesday, July 18, 2012 10:51 AM
  • hi thomas,

    thanks for reply

    when opportunity close as won one page opens that will ask for project information like name,milestone,amount.

    you can look at this image

    So, if i have checkbox result than i can return from page_load function.

    Wednesday, July 18, 2012 11:03 AM
  • I second what Thomas says. Customizing the out-of-box CRM page is really a bad idea.

    But if you really want to acheive this via your solution, you will have to create entity record from soap calls.

    Refer the link http://msdn.microsoft.com/en-us/library/cc677070.aspx This will give you an insight of how to create the envelope.

    You won't be able to get the checked state of this checkbox in plugin coz the field does not exist in the CRM databases.


    Piyush

    Wednesday, July 18, 2012 11:05 AM
  • Hi again,

    you could try:

    • Create a new bool-field on opportunity
    • add your checkbox as you described
    • in onclick event of the checkbox try to access the crm-opportunity form (opener in javascript) and try to set the value of the newly created field (something like opener.crmForm.new_createdField.DataValue = true | false)
    • then in your plugin code, you can check this field...

    Greetz

    Thomas

    Wednesday, July 18, 2012 11:37 AM