You need to sign in to do that
Don't have an account?
Dritter
Custom Link using OnClick JavaScript
We have an umlimited edition and I'm trying to create a new record called a "support ticket" off of a user's record (custom link). Below is the script, but when I click the button I get the following error:
A problem with the OnClick JavaScript for this button or link was encountered: Unexpected token ILLEGAL
-------Script-------
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
var st = new sforce.SObject('Support_Ticket__c');
st.RecordType = 'Magic Ticket';
st.On_Behalf_Of__c = {!User.Id};
var result = sforce.connection.create([st]);
if(result[0].getBoolean("success")){
window.location = "/" + result[0].id + "/e";
}else{
alert('Could not create record '+result);
}
A problem with the OnClick JavaScript for this button or link was encountered: Unexpected token ILLEGAL
-------Script-------
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
var st = new sforce.SObject('Support_Ticket__c');
st.RecordType = 'Magic Ticket';
st.On_Behalf_Of__c = {!User.Id};
var result = sforce.connection.create([st]);
if(result[0].getBoolean("success")){
window.location = "/" + result[0].id + "/e";
}else{
alert('Could not create record '+result);
}
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
var st = new sforce.SObject('Support_Ticket__c');
st.On_Behalf_Of__c = User.id;
var result = sforce.connection.create([st]);
if(result[0].getBoolean("success")){
window.location = "/" + result[0].id + "/e";
}else{
alert('Could not create record '+result);
}