You need to sign in to do that
Don't have an account?

Cloning an object in Scontrol
I am trying to Clone a custom object in the S-Control, and I am stuck can some one share their experience of cloning the object which is having parent child relationship with other objects.
try something like the above code?
hi,
what will be the query if the object is Standard one? i am trying this thing on standard object. thanks for co-operation. Pls check the error in the code below:
It is giving exception in the query highlited below.
<html>
<head>
<script src="/soap/ajax/8.0/connection.js"></script>
<script src="/desktop/desktopApi.js"></script>
<script>
// Query all the fields of the custom object
var result = sforce.connection.query("select Account,NextStep from Opportunity where Id=: OpportunityId" );
var records = result.getArray("records");
// Create an instance of a custom_object
var new_Custom_Object = new sforce.SObject("Opporutnity_cloned__c");
new_Custom_Object.Account = records[0].Account;
new_Custom_Object.NextStep = records[0].NextStep ;
// Create the Object
try
{
var saveResult = sforce.connection.create( new_Custom_Object );
// Check to see that the object was created successfully
if ( saveResult[0].getBoolean("success") )
{
alert( "Success " );
}
else
{
alert( "Error occurred: " + saveResult[0] );
}
//}
</script>
</head>
<body onload="init()">
<p>
</p>
</body>
</html>
regards,
rupinder.
var new_Custom_Object = new sforce.SObject("Opportunity");
Message Edited by Whyser on 06-18-2008 01:41 PM