Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.