Access Close Opportunity webpage dialog with javascript

Last post 01-07-2010 10:17 PM by Andrew Lynn. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-03-2010 7:34 PM

    Access Close Opportunity webpage dialog with javascript

     Hi,

    I am using CRM 4.0 and I am trying to open close opportunity webpage dialog with javascript in Opportunity form. Everytime user change Sales Stage field to a certain value, e.g. 0, then the close opportunity webpage dialog will be opened and the Actual revenue is filled automatically with estimated revenue in Opportunity form. The behaviour must be the same as if a user click Actions menu and then click Close Opportunity.

    I have tried to put this code in onChange event of Sales Stage field as follows:
     var salesStg= crmForm.all.salesstagecode.DataValue;
     switch (salesStg)
     {
       case '0':
         crmForm.Save(); 
         var guid = crmForm.ObjectId;
         var url = 'http://152.19.13.246:5555/mycompany' + '/SFA/opps/dlg_closeopp.aspx?pID=' + guid 
         window.open (url, "mywindow", "status=1", "toolbar=1"); 
         break;
      }
    When I tested the above code, the webpage dialog is opened but in error state.
    How to get GUID from the opportunity form properly? How to filled Actual Revenue field in Webpage dialog with Estimated Revenue in Opportunity form?
    How exactly should I do to correct the above error?

    Thanks for your help.
    Andrew

  • 01-03-2010 8:40 PM In reply to

    Re: Access Close Opportunity webpage dialog with javascript

    Hi Andrew,

    you have set the GUID value properly. To set the values of Actual Revenue field you need to modify your Query String as given below.

    var url = 'http://152.19.13.246:5555/mycompany' + '/SFA/opps/dlg_closeopp.aspx?pID=' + guid + '&estimatedVal=' + crmForm.all.estimatedvalue.DataValue

    It fills the value of Actual Revenue in the new window.

    Thanks!

    Sam

    --------------------------
    Inogic
    Innovative Logic
    Innovative solutions for your SME ERP/CRM products
    E-mail: crm@inogic.com
    Web: www.inogic.com
    blog:http://inogic.blogspot.com
    --------------------------
  • 01-07-2010 10:17 PM In reply to

    Re: Re: Access Close Opportunity webpage dialog with javascript

    thanks for your help.

    Regards,

    Andrew

Page 1 of 1 (3 items)