Let's say that you are working in a large Org and different groups throughout the company use the same object, but each a little differently. Instead of overriding the standard "Edit" or "New" buttons, create a custom button.
For example, there is a custom object on the standard Opportunity object and you want to launch a different page layout for your sales team for a custom quoting object.
For example, there is a custom object on the standard Opportunity object and you want to launch a different page layout for your sales team for a custom quoting object.
- Create your "Quote" Visualforce page.
- Create the custom button on the custom object.
- Label: New
- API Name: New_Quote
- Type: List Button
- Content Source: OnClick JavaScript
- Behavior: Execute JavaScript
- Button or Link URL:
- window.open("/apex/InputVisualforcePageNameHere?RecordType=InputRecordTypeIdHere&retURL={!Opportunity.Id}&cancelURL={!Opportunity.Id}&saveURL={!Opportunity.Id}","_parent");
- Edit the Opportunity page layout for the sales team and modify the buttons on the related list to add your custom button.
In order to be able to edit the record with the Visualforce page layout too, you will need to create a Detail Page Button on the custom object.
Simply...
- Create the custom button on the custom object.
- Label: Edit
- API Name: Edit_[InputVisualforcePageNameHere]
- Content Source: Visualforce Page (Quote)
- Behavior: Display in existing window with sidebar
- Add the custom button to the sales team's page layout for the custom Quote object.
Comments
Post a Comment