+ Start a Discussion

Sharing Button on Vf page


i have a vf page for my contract object and how do i get sharing button on to this vf page , i have tried the way how i gave edit and save but it does not work . And one more thinng i can see sharing button on my standard page


You can use the below markup to create a commandbutton which displays a Share button and performs the same action as a share button does on the standard view page. You can use contract instead of Account. The below markup assumes you are using the VF page with standard controller.


<apex:commandButton action="{!URLFOR($Action.Account.Share,Account.Id)}" value="Share"/>


HI thanks for replying , i am using the tag but i am getting an error saying 


Error: Field $Action.contract.Share does not exist. Check spelling


  this is the way i am using 


<apex:pageBlockButtons >
<apex:commandButton value="edit" action="{!edit}" />
<apex:commandButton value="delete" action="{!delete}" />
<apex:commandButton value="Clone" action="{!clone}"/>
<apex:commandButton action="{!URLFOR($Action.contract.Share,contract.Id)}" value="Share"/>


Contract sharing object is not available as per my knowledge.






mahamed raheemmahamed raheem
am trying sharing for contact object am get error like

Unknown property 'Contact.id' referenced in sharing

my vf page

 <apex:commandButton value="Share" action="{!URLFOR($Action.Contact.Share, Contact.id)}"/>