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

Create a case clicking a custom button in Account object
My scenario is to create a Custom button in Account object while clicking that button it show some required field in Case their I want to add submit custom button after clicking that it will create a case record from that account.
I am pretty new to Salesforce development. Can anyone give me suggestion to do this.
Thanks in Advance.
I am pretty new to Salesforce development. Can anyone give me suggestion to do this.
Thanks in Advance.
{!REQUIRESCRIPT(“/soap/ajax/30.0/connection.js”)}
var c = new sforce.SObject(“Case”);
//your field values like
c.accountId='{!accountId}';
var result = sforce.connection.create([c]);
if(result[0].getBoolean(“success”)){
window.location = “/” + result[0].id + “/e”;
} else {
alert(‘Could not create record’ +result);
}
<apex:page standardController="Case" action="{!Save}">
<!--
do your logic here.
-->
</apex:page>
If you have any logic need to do in Save then call the custom controller in the page.like
<apex:page controller="yourClass" action="{!saveLogic}">
</apex:page>
Your Controller
------------------------
public class yourClass {
public void saveLogic() {
// your logic
insert caserec;
}
}