• rstanbau
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies

Hi - I'm trying to write code to overwrite Opportunity.Amount with a value caluclated in a calculated field.  I've tried a couple of differnt approaches, but am stumped.

 

My latest attempt was to write a class with a method that copied the value in a user-defined field to the opportunity.amount field  when the record was saved.  I also tried writing similar code that updates one or more selected records and is executed on a button is clicked from a list page.  This apporach, like the others that I have tried, resulted in an error saying that opportunity.amount is a read-only field.

 

I'm stumped.

 

I've had no problem updating and manipulating other standard object fields.  The Oppportunity.Amount field is an important one to contain meaningful data, as it is referenced by SF forecasting and Campaigns.  So far, I am not able to put the values in this field that I would like it to contain. 

 

I would really appreciate any guidance that is provided about how I can achieve this (or if it is hopeless - which I cannot believe).

 

Thank you!

Rich

 

Hi - I'm trying to setup Eclipse 3.4.2 with the Apex Toolkit.  I added the Apex Eclipse Toolkit from http://adnsandbox.com/appexchange/e3.2s.  Afterwards, I was able to see my SControls, Triggers and appexchange.schema.
However - when I double on an SControl in order to edit it, I get the following error:  "Could not open the editor: The editor class could not be instantiated. This usually indicates a missing no-arg constructor or that the editor's class name was mistyped in plugin.xml."
I've reviewed all the installed modules, but am not having any luck fixing the problem... can anyone point me in the right direction?
Thanks,
Rich 

Hi - I'm trying to write a piece of javascript to execute when a button is clicked to update the Amount field(or fields for multi select) of Opportunities.  I'm having trouble (an unrecognized ; ?) with the following bit fo code and would appreciate any help you may send my way.  

 

Also - could someone please point me towards a document that lists all the SF standard objects with their properties and methods?  

 

Thank you in Advance, 

Rich 

 

 

{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}

var records = {!GETRECORDIDS( $ObjectType.Opportunity )};

var newRecords = [];

 

if (records[0] == null)

{ alert("Please select at least one row!") }

 

else

{

for (var n=0; n<records.length; n++)

{

var c = new sforce.SObject("Opportunity");

c.Id = records[n];

 

// I want to replace the Amount with a calculated field from the current record 

c.Amount = {!Opportunity.FirstYearValue__c};

newRecords.push(c);

}

result = sforce.connection.update(newRecords);

window.location.reload();

}

 


 

Message Edited by rstanbau on 06-04-2009 10:22 AM
Message Edited by rstanbau on 06-04-2009 07:48 PM
Message Edited by rstanbau on 06-04-2009 07:50 PM