You need to sign in to do that
Don't have an account?
Cristian Trif
button that creates a Quote and a Contract
Hello,
So the requirement is to reduce the button clicks so I need to create a button on the Opportunity Layout and when pressed should automatically create a Quote and a Contract related to the that opportunity and also redirect to a visualforce page that contains the Price, Model and the Brand of a vehicle. We have an custom object called, Vehicle so all the fields are in this object.
This is the page layout of Opportunities of where i want my button to be.
and also the related lists where are Quotes and Contracts.
Use a javascript button for this,
Use the below code for reference.
So where you said var new Contract = new sforce.sObject("Contract");
// add contract fields.. here it means that i should add the required fields when creating a contract?
Also I need to create a Contract and Quote. Can i just replace instead of Order to be Quote instead?
here it means that - i should add the required fields when creating a contract? - Yes
Can i just replace instead of Order to be Quote instead? - Yes You can just make sure you're populating required fields.
this code I can add in a Apex Class? - Scripts cannot be added on Apex Class, Hence answer is No.