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