You need to sign in to do that
Don't have an account?
Nordberg
S-control to post from standard case object to custom object via a button
Hello,
I am new to S-control's and am trying to allow a user to click a button and create a new custom object record with data being copied from the case object. Listed below is my code, I do not receive any error, I just end up with a blank page. I could be completely off here, but any help would be greatly appreciated.
I am new to S-control's and am trying to allow a user to click a button and create a new custom object record with data being copied from the case object. Listed below is my code, I do not receive any error, I just end up with a blank page. I could be completely off here, but any help would be greatly appreciated.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <title>Copy Data From Convereted Lead</title> <HEAD> <script src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script> <script type="text/javascript"> var srcObj = sforce.connection.retrieve( "Id, Employee_First_Name__c, Employee_Last_Name__c, Address_line_1__c", "Case", ["Case"]); var trgtObj = new sforce.SObject("Employee__c"); trgtObj.set("Employee_Last_Name__c", srcObj[0].get("Employee_Last_Name__c")); trgtObj.set("First_Name__c", srcObj[0].get("Employee_First_Name__c")); trgtObj.set("Street_Address__c", srcObj[0].get("Address_line_1__c")); var saveResult = sforce.connection.create([trgtObj]); alert(saveResult[0].getBoolean("success") — "Operation Successful" : "Operation Failed"); </script> </HEAD> <body> </body> </html>
http://salesforce.phollaio.com/2007/01/16/play_with_custom_links/
http://www.thoughtsonsalesforce.com/2006/10/url-structure.html
http://salesforce.phollaio.com/2007/04/02/how_to_obtain_a_field_id/
No need to use an S-Control when a URL will do. More simple AND fewer possible browser security errors and Firefox problems.