function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jwingjwing 

Can't get ID of newly created SObject

var opportunity = new Sforce.Dynabean("Opportunity");

opportunity.set(.....
.....

if (saveResult[0].success == true) {
            output += "Opportunity has been created, ID is: " + saveResult[0].Id + "."; 
            document.getElementById("output").innerHTML = output;
}

But I got this eventually:
    "Opportunity has been created, ID is: undenfined."
Ron HessRon Hess
try :
saveResult[0].id     <<<< __ note lowercase "i"

or saveResult[0].toString() to see all the fields

a good debugger will also show you the members of the saveResult object array
jwingjwing
Tks Ron, it works with lowercase. Maybe you should update the tutorial:

http://www.writely.com/View.aspx?docid=aknntgrrcfb_bcggcbnj6gz5b