Opportunity Name= Account Name , in same way we will take few fields.
I have tried created OnClick JavaScript Button, Please help, how do i ractify code
{!REQUIRESCRIPT("/soap/ajax/43.0/connection.js")}
var opp = new sforce.SObject('Opportunity');
opp.Name= '{!Account.Name}';
opp.stageName='Prospecting';
opp.CloseDate="{!Account.SLAExpirationDate__c}";
opp.AccountId ="{!Account.Id}";
/// you can Map other fields here...
result = sforce.connection.create([opp ]);
var newurl = window.open.href;
if(result[0].getBoolean("success")){
window.location = "/" + result[0].id + "/e";
}else{
alert('Could not create record '+result);
}
Thanks in Advance...!!
1 件の回答
Hello Preeti,
I'm not sure of your full requirements here but you can use a Standard Quick Action and have certain fields pre-defined without the need for any code.
Have you considered this option?
Thanks, Tom