Activity Forums Salesforce® Discussions Is there any way to perform DML operations from visualforce email templates?

  • Is there any way to perform DML operations from visualforce email templates?

    Posted by Nitish on April 14, 2016 at 9:16 AM

    Visualforce email templates allow you to include visualforce components with allowDML=”true” but there doesn’t appear to be any way to actually use DML. But getting these when trying to implement :-

    You can’t use data manipulation language (DML) operations in a “getxxx” method in a controller.

    You can’t use data manipulation language (DML) operations in a constructor method in a controller.

    So is there any way to do this?

    Utsav replied 10 years ago 2 Members · 1 Reply
  • 1 Reply
  • Utsav

    Member
    June 9, 2016 at 1:08 PM

    Hi

    I think it is not possible once i had faced the same issue , there exists some interface which resists us from performing a SOQL in visualforce email templates.

    Thanks

Log In to reply.