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
etessetess 

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.

etessetess

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.

LennyTLennyT

Did you ever find an answer for this? I'm having the same issue.

 

Thanks in advance!

AshleyMorrisAshleyMorris
I have the same issue too.  I want to delete a CaseComment but cannot use URLFOR as there is no standard controller action for caseComment.delete. 

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?
NZArchitectNZArchitect
Maybe someone from @Salesforce could jump in and help out here???
Gagandeep Brar 4Gagandeep Brar 4
Below is code for custom Javescript Button that worked for me

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])}'; 
}