• sbooth1440
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi All!  I have the need to update the AMOUNT field in an Opportunity with a calculated field.  The Amount field is not natively a calculated field.  I searched for assistance in help and found a solution on the site (listed below).  This solution also had a word document attached that had the HTML required for this S-Control.  I did the following:
 
1.  I already had the calculated field called "Total Opportunity" created and it is working fine.
2.  I created the S-Control and pasted in the HTML from the solution I found.  I changed the field name in the HTML to my field name for Total Opportunity. (total_opportunity_value_c) in the code.
3.  I changed the page layout to embed the S-Control (and then tried a button, and then a customer link).
 
Unfortunately in all situations I did get a window saying "Updating Amount Field" (that's driven from the HTML) but it just hangs there and doesn't do anything.  My assumption is that it's an error in the HTML but, as me not being a coder, I can't debug.  Anyone out there able to quickly eyeball and see where there may be an issue? 
 
Also - is there a way for me to send the "fix", if I get one, back to SF.com so that this solution on their site is actually correct????
 
Thanks to all in advance!!!!!!
 
Here is the "solution" found on sf.com:
*********************************************************************************************
The definition behind the native Opportunity Amount field does not allow for the creation of a formula field. As a result, the amount field on opportunities cannot be a calculated value based upon other fields on the Opportunity record.

The Solution is as follows:

1. Create a custom field on the Opportunity to perform the requested calculation.
2. Create an S-Control that edits the Opportunity, placing the custom field's value (the one created in step 1) into the Amount field on the Opportunity.
3. Create a custom link or formula field (see below) that will invoke the S-Control when clicked.

- Sample code has been provided for the S-Control in Step 2 in the "Attachments" section of this record. (NOTE: Replace the merge field {!Opportunity_Requested_Price} in the provided code with the calculated field in your Opportunity configuration (step 1)).

- Additionally, the following is an example of a formula field that will invoke a given scontrol:

HYPERLINK("/servlet/servlet.Integration?lid=01N30000000D0vg&eid="&{!Id}, "Update" )
(NOTE: The record ID in the above should be replace the record ID of your S-Control, created in step 2).
**********************************************************************************************************************************
Here is the HTML (I did replace my calculated field name): 
 

Solution: Update Opportunity Amount Field With a Calculated Value

Owner: Chris Morgan

 
Process to create the S-Control discussed in Step 2 of this solution:
 <HTML> 
<HEAD>
<TITLE>Status...</TITLE>
</HEAD>
<center>
<table width="100%">
<tr>
<td align=center>
<span class="moduleTitle"><h4>Updating ''Amount'' field<Br>Please wait...</span>
</h4></td>
</tr>
<tr>
<td align=center>
<img src="/img/waiting_dots.gif" border="0" width=156 height=34>
</td>
</tr>
</table>
</center>

<script language="JavaScript">
setTimeout("",5000);
window.parent.opener.location="/{!Opportunity.Id}/e?retURL=%2F{!Opportunity.Id}&opp7={!Opportunity.total_opportunity_value__c}&save=1";
setTimeout("window.close();", 5000);
</script>
</HTML>
Hi All!  I have the need to update the AMOUNT field in an Opportunity with a calculated field.  The Amount field is not natively a calculated field.  I searched for assistance in help and found a solution on the site (listed below).  This solution also had a word document attached that had the HTML required for this S-Control.  I did the following:
 
1.  I already had the calculated field called "Total Opportunity" created and it is working fine.
2.  I created the S-Control and pasted in the HTML from the solution I found.  I changed the field name in the HTML to my field name for Total Opportunity. (total_opportunity_value_c) in the code.
3.  I changed the page layout to embed the S-Control (and then tried a button, and then a customer link).
 
Unfortunately in all situations I did get a window saying "Updating Amount Field" (that's driven from the HTML) but it just hangs there and doesn't do anything.  My assumption is that it's an error in the HTML but, as me not being a coder, I can't debug.  Anyone out there able to quickly eyeball and see where there may be an issue? 
 
Also - is there a way for me to send the "fix", if I get one, back to SF.com so that this solution on their site is actually correct????
 
Thanks to all in advance!!!!!!
 
Here is the "solution" found on sf.com:
*********************************************************************************************
The definition behind the native Opportunity Amount field does not allow for the creation of a formula field. As a result, the amount field on opportunities cannot be a calculated value based upon other fields on the Opportunity record.

The Solution is as follows:

1. Create a custom field on the Opportunity to perform the requested calculation.
2. Create an S-Control that edits the Opportunity, placing the custom field's value (the one created in step 1) into the Amount field on the Opportunity.
3. Create a custom link or formula field (see below) that will invoke the S-Control when clicked.

- Sample code has been provided for the S-Control in Step 2 in the "Attachments" section of this record. (NOTE: Replace the merge field {!Opportunity_Requested_Price} in the provided code with the calculated field in your Opportunity configuration (step 1)).

- Additionally, the following is an example of a formula field that will invoke a given scontrol:

HYPERLINK("/servlet/servlet.Integration?lid=01N30000000D0vg&eid="&{!Id}, "Update" )
(NOTE: The record ID in the above should be replace the record ID of your S-Control, created in step 2).
**********************************************************************************************************************************
Here is the HTML (I did replace my calculated field name): 
 

Solution: Update Opportunity Amount Field With a Calculated Value

Owner: Chris Morgan

 
Process to create the S-Control discussed in Step 2 of this solution:
 <HTML> 
<HEAD>
<TITLE>Status...</TITLE>
</HEAD>
<center>
<table width="100%">
<tr>
<td align=center>
<span class="moduleTitle"><h4>Updating ''Amount'' field<Br>Please wait...</span>
</h4></td>
</tr>
<tr>
<td align=center>
<img src="/img/waiting_dots.gif" border="0" width=156 height=34>
</td>
</tr>
</table>
</center>

<script language="JavaScript">
setTimeout("",5000);
window.parent.opener.location="/{!Opportunity.Id}/e?retURL=%2F{!Opportunity.Id}&opp7={!Opportunity.total_opportunity_value__c}&save=1";
setTimeout("window.close();", 5000);
</script>
</HTML>