You need to sign in to do that
Don't have an account?
Token for URL to delete a record?
I have a custom VF page that is using the standard Opportunity controller and an extension. In the VF page, I'm displaying OpportunityContactRoles in a Data Table so that I can have some additional columns/information displayed that are not options within the standard OpportunityContactRoles related list. My problem is that I have to manually add in the Del link (that appears in the "Action" column on the Opportunity Contact Roles related list) but can't seem to figure out the URL to use.
I see that the Del button links to /setup/own/deleteredirect.jsp with the following parameters:
- id --> opportunity id
- delID --> opportunitycontactrole id to delete
- retURL --> the return URL
- _CONFIRMATIONTOKEN --> ??
What is the confirmation token, and how do I determine it?
If there is an easier way to approach this rather than hacking the URL myself please let me know.
Try this post.. May be this helps:
http://boards.developerforce.com/t5/Visualforce-Development/Delete-Confirmation-Message-Box/m-p/70736#M983
Hmm, using the code they discuss there is getting the same result. When I only set those three parameters and click "Del," I get the confirm delete pop up window, and click OK. It then takes me to another page with the following error: "The attempted delete was invalid for your session. Please confirm your delete." Which has another delete button that doesn't work either.
Did you ever find an answer for this? I'm having the same issue.
Thanks in advance!
The method shown above using the deletedirect.jsp worked for me until a few weeks ago and now puts me into a looping page to delete that never works.
I have read elsewere that the CONFIRMATIONTOKEN is a hidden form item. Does anyone know how to create a URL with this token in it?
if ((Modal.confirm && Modal.confirm('Are you sure?')) || (!Modal.confirm && window.confirm('Are you sure?')))
{
window.location.href = '{!URLFOR($Action.Child_Obj_ApiName.Delete, Child_obj.Id, [retURL=Marter_Obj.Id])}';
}