Find your content:

Search form

You are here

Activate/Deactivate action on Product list

 
Share

In the Product list table you have an Activate/Deactivate action links (the left column). When I click these the action does not fire the On Update trigger I have. If I implement a custom button to change the Active field the trigger is fired.

This is my trigger definition:

trigger ProductTriggers on Product2 (before insert, before update, after insert, after update, after delete) {

}

Has anyone ran into the same problem? Is it a bug?


Attribution to: Dedo

Possible Suggestion/Solution #1

I just confirmed this is happening in my dev org as well. It also looks like others are running into this issue as well. Stolen from a link on the Developer Boards by sfdcfox,

I've confirmed this behavior. It's calling the standard edit controller ( /{!Product2.Id}/e?act=0&retURL... ) that does not have the usual save=x parameter (where x is any value, but usually the word Save). It seems to bypass all validation, workflow, and trigger logic. Nothing shows up in the debug logs at all. I suspect that this is a bug, and you should report it to Technical Support.

sfdcfox also posts a workaround to solve this:

...if you override the product2.edit action with a Visualforce component, you can perform the update in your custom code, which fires your trigger correctly. This is only a shortterm solution, as it introduces a CSRF attack, but is no worse than the original problem, which is also CSRF vulernerable. Alternatively, have the edit page offer them a chance to cancel or confirm the action so you yourself prevent the CSRF attack.


Attribution to: Mikey
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4750

My Block Status

My Block Content