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
CTU007CTU007 

How to add detail page button into VF page

Hi, I have several detail page button on opportunity to make it easier for users to do certain things like creating contract from the opportunity.

 

 Now I am trying to override the opportunity detail view page, and I dont know how to add those custom buttons to the page layout. It seems like I can only add standard buttons like "edit", "delete" buttons.

 

Also, how to add the "clone", "Sharing" button to the page layout... I got error:

 

Error: Unknown method 'OpportunityStandardController.clone()'

 

lee_carter73lee_carter73
I am trying to do the same thing.  Had any luck finding a solution?
CTU007CTU007
This is what I did, it works but may not be the answer.

<apex:commandButton value="Edit" action="{!edit}" /> <input value="Delete" class="btn" name="del" onclick="if ((Modal.confirm && Modal.confirm('Are you sure?')) || (!Modal.confirm && window.confirm('Are you sure?'))) navigateToUrl('/setup/own/deleteredirect.jsp?delID={!Opportunity.id}&amp;retURL=%2F006%2Fo&amp');" title="Delete" type="button" /> <input value="Clone" class="btn" name="clone" onclick="openIntegration('/{!Opportunity.id}/e?clone=1&amp;retURL=%2F{!Opportunity.id}')" title="Clone" type="button" /> <input value="Request CP" class="btn" name="request_cp" onclick="openIntegration('/a0Y/e?retURL=%2Fa0Y%2Fo&RecordType=0120000xxxxxx&00N00000008aCu9=CP(Overal lPricing)&CF00N00000008aCuC={!Opportunity.Name}&CF00N00000008aCuC_lkid={! Opportunity.Id}&00N00000008aCwL=New')" title="Request CP" type="button" /> <input value="Create Contract" class="btn" name="create_sla" onclick="openIntegration('/800/e?retURL=%2F800%2Fo&RecordType=01200000xxxxxxxx&CurrencyIsoCode={!Opportunity.CurrencyIsoCode}&CF00N000000072xso={!Opportunity.Name}&CF00N000000072xso_lkid={!Opportunity.Id}&ctrc13=60&ctrc7={!Opportunity.Account.name}&ctrc7_lkid={!Opportunity.AccountId}')" title="Create Contract" type="button" /> </apex:pageBlockButtons>