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
AtnMAtnM 

DML from Components

Hi all,

 

It seems that DML actions are not allowed in component objects. My use case is for a form component that can be displayed on any visualforce page to collect contact information. Is there a way around the DML restriction in components? I've tried passing in the controller of the visualforce page and calling it's actions but I get a visualforce error with no message just the name of the action I'm trying to call. Any ideas or is DML for components on the road map? 

 

Thanks!

Scott

Best Answer chosen by Admin (Salesforce Developers) 
BulentBulent
You need to set allowDml="true" in the <apex:component>

All Answers

BulentBulent
You need to set allowDml="true" in the <apex:component>
This was selected as the best answer
AtnMAtnM

So simple :) and it's right in the component reference too.

 

Sorry about that I got the exception saying it wasn't allowed and assumed there was no way to make it allowed.

 

Thanks! 

 

Scott