You need to sign in to do that
Don't have an account?

Need help to create output link
Hi,
I need to create edit and delete output link for contact object records which is lookup to account and my vf page looks like standard account detail page and when i click edit link it should edit the record and delete option should delete the record.
i dont know how to create the link..any help...
Thanks, in advance..
I need to create edit and delete output link for contact object records which is lookup to account and my vf page looks like standard account detail page and when i click edit link it should edit the record and delete option should delete the record.
i dont know how to create the link..any help...
Thanks, in advance..
Here is the working code:
<apex:page standardController="account" >
<apex:form >
<apex:pageBlock title="Account Contacts">
<apex:pageBlockTable value="{!account.contacts}" var="cont">
<apex:column >
<apex:outputLink value="{!URLFOR($Action.Contact.Edit, cont.id)}">
Edit
</apex:outputLink>
<apex:outputLink value="{!URLFOR($Action.Contact.Delete, cont.id)}">
Delete
</apex:outputLink>
</apex:column>
<apex:column value="{!cont.firstname}"/>
<apex:column value="{!cont.lastname}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Thanks,
Pratik
P.S. If this answers you question, please mark it as "Best Answer" so it will help other community members too.
All Answers
Here is the working code:
<apex:page standardController="account" >
<apex:form >
<apex:pageBlock title="Account Contacts">
<apex:pageBlockTable value="{!account.contacts}" var="cont">
<apex:column >
<apex:outputLink value="{!URLFOR($Action.Contact.Edit, cont.id)}">
Edit
</apex:outputLink>
<apex:outputLink value="{!URLFOR($Action.Contact.Delete, cont.id)}">
Delete
</apex:outputLink>
</apex:column>
<apex:column value="{!cont.firstname}"/>
<apex:column value="{!cont.lastname}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Thanks,
Pratik
P.S. If this answers you question, please mark it as "Best Answer" so it will help other community members too.
For more standard controller actions you can refer to:
http://www.salesforce.com/docs/developer/pages/Content/pages_controller_std_actions.htm
Thanks,
Pratik