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
SF7SF7 

Sharing Button on Vf page

hi 

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

ram4SFDCram4SFDC

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"/>

SF7SF7

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"/>
</apex:pageBlockButtons>

Rahul_sgRahul_sg

Contract sharing object is not available as per my knowledge.

 

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_contract.htm#topic-title

 

Thanks,

Rahul

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

Unknown property 'Contact.id' referenced in sharing


my vf page

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

 </apex:page>