You need to sign in to do that
Don't have an account?
Gautier Swiercz 7
Problem on custom button create note record
Hi,
Here my custom button code :
"{!REQUIRESCRIPT('/soap/ajax/22.0/connection.js')}
var not = new sforce.SObject('Note');
not.Title = '{!Opportunity.StageName}' + '{!Opportunity.Name}';
not.OwnerId = '{!Opportunity.OwnerId}';
not.ParentId = '{!Opportunity.Id}';
result = sforce.connection.create([not]);
if(result[0].getBoolean('success')){
window.location = '/' + result[0].id + '/e';
}else{
alert('Could not create record '+result);
}"
This custom button do that :
- create a new note related to my current opportunity
- Then, load a new page, with the current note, with the correct title, but when i click on "save", nothing.
Can anyone help me ?
Here my custom button code :
"{!REQUIRESCRIPT('/soap/ajax/22.0/connection.js')}
var not = new sforce.SObject('Note');
not.Title = '{!Opportunity.StageName}' + '{!Opportunity.Name}';
not.OwnerId = '{!Opportunity.OwnerId}';
not.ParentId = '{!Opportunity.Id}';
result = sforce.connection.create([not]);
if(result[0].getBoolean('success')){
window.location = '/' + result[0].id + '/e';
}else{
alert('Could not create record '+result);
}"
This custom button do that :
- create a new note related to my current opportunity
- Then, load a new page, with the current note, with the correct title, but when i click on "save", nothing.
Can anyone help me ?
Please find the below code:
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
var not = new sforce.SObject("Note");
not.Title = '{!Opportunity.StageName}' + '{!Opportunity.Name}';
not.ParentId = '{!Opportunity.Id}';
not.OwnerId = '{!Opportunity.OwnerId}';
var result = sforce.connection.create([not]);
if(result[0].getBoolean("success")){
window.open("/" + result[0].id + "/e");
}else{
alert('Could not create record '+result);
}
Make it as solution if it answers your question.
Rgrds,
Rabi