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
KruviKruvi 

Product after update trigger and Product Activation

Hi

 

I'm really lost on this one.

I have an After Update trigger on Product, when I hit the activate/deactivate action link on a product in the Products search result list the checkbox is updated correctly BUT the trigger is not fired.

For testing purposes I implemented a button to do the same and when I use it to  activate/deactivate it works fine.

 

Any suggestion why this happens and how to solve it and get the triggered fired when I use the action link?

 

Much appreciated

 

 

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox

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.

All Answers

sfdcfoxsfdcfox

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.

This was selected as the best answer
KruviKruvi

Thanks a lot :-)

 

Do you have any idea if this action link can be removed?

I don't want ambiguous behavior in my app

sfdcfoxsfdcfox

You can't remove it, as it is a standard link. However, 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.

Rolando EstevesRolando Esteves

Is this issue fixed already? Or do we still need to change our product2.edit page ?