You need to sign in to do that
Don't have an account?
ahammad sk
Create Edit page using Visualforce standard controller...?
Hi,
In visualforce edit page "Edit" and "Delete" links are not working.
<apex:page standardController="contact" recordSetVar="contacts">
<apex:pageBlock title="Contacts" mode="Edit">
<apex:form >
<apex:pageBlockTable value="{!Contacts}" var="contact" >
<apex:column >
<apex:facet name="header">action</apex:facet>
<apex:commandLink value="Edit" action="{!edit}" />
</apex:column>
<apex:column >
<apex:facet name="header">action</apex:facet>
<apex:commandLink value="Delete" action="{!delete}" />
</apex:column>
<apex:column value="{!contact.Name}"/>
<apex:column value="{!contact.MailingCity}"/>
<apex:column value="{!contact.Phone}"/>
</apex:pageBlockTable>
</apex:form>
</apex:pageBlock>
</apex:page>
In visualforce edit page "Edit" and "Delete" links are not working.
<apex:page standardController="contact" recordSetVar="contacts">
<apex:pageBlock title="Contacts" mode="Edit">
<apex:form >
<apex:pageBlockTable value="{!Contacts}" var="contact" >
<apex:column >
<apex:facet name="header">action</apex:facet>
<apex:commandLink value="Edit" action="{!edit}" />
</apex:column>
<apex:column >
<apex:facet name="header">action</apex:facet>
<apex:commandLink value="Delete" action="{!delete}" />
</apex:column>
<apex:column value="{!contact.Name}"/>
<apex:column value="{!contact.MailingCity}"/>
<apex:column value="{!contact.Phone}"/>
</apex:pageBlockTable>
</apex:form>
</apex:pageBlock>
</apex:page>
For delete operation we need to pass Id
Code modified
Please use the below code
Please mark this as solution if this solves your problem, So that if anyone has this issue this post can help
All Answers
For delete operation we need to pass Id
Code modified
Please use the below code
Please mark this as solution if this solves your problem, So that if anyone has this issue this post can help
Thanks your reply..
I modified the code with:
<apex:column >
<apex:facet name="header">action</apex:facet>
<apex:inputHidden value="{!contact.Id}"/>
<apex:commandLink value="Delete" action="{!delete}" />
</apex:column>
But the issue is not able to see "Edit" and "Delete" links in each record of action column.
I don't feel there should be any issue.
I have tried the code in my Developer org it is showing all links.
try it in your developer org and let me know if same error persists.
Your URL should be
http://yoursalesforceInstanceaddress/apex/PageName?id=contactId
Please mark this as solution if this solves your problem, So that if anyone has this issue this post can help
Thanks your reply........
If we pass "contactid" in url then it is showing EDIT and DELETE links.
For display all the conact records we dont need to pass contactid, But why we are passing "contactid".
Thanks
In salesforce standard operations we use Id,
If you use a custom delete function then you can have any unique field.
For Example.
Say I need to delete a record whose unique field name is myEmployeeId
Then you need to pass this id to delete that particular record.
Hope this makes sense.