function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jm@idcjm@idc 

VF - Create New Record with User Input

This seems like it should be uber simple but I've been having trouble.  I have a custom object (Quotation) tied to Opportunity and would like to put a custom button on the opportunity page layout which creates a new quotation request.  It would pre-populate most quotation fields and open 1 field up for user input ... Upon save a new quotation record would be create and cancel should send the user back to the opportunity form.
 
The button with a custom url calling a VF page works fine and I can display / modify an existing record but I'm not sure about creating a new record.
 
Any help would be appreciated.  I'm a newb with regards to Apex/VisualForce so the more basic the instructions the better :).
LumingLuming
1. pass id of opportunity to your visualforce page.
2. create a custom controler for your visualforce page, get information related to passed opportunity id
3. link button or commandlink in your visualforce page to a {!create} method in your custom controller class
4. in create method, create a new sObject and insert it.
shan876shan876
Hi I was viewing this and wanted to know if you have an example of this please...Thanks