You need to sign in to do that
Don't have an account?
sfadm sfadm
How to invoke controller setter method in trigger beforeInsert()?
I have a custom VF page:
AND That is the controller class to the VF page:
The issue I strive to solve is that beforeInsert() method is in another class.
<apex:page standardController="Lead" extensions="LeadDuplicateController" tabStyle="Lead"> <apex:pageBlock > <apex:pageBlockSection title="Lead Information"> <apex:outputText value="{!plainHTML}" escape="false" /> </apex:pageBlockSection> </apex:pageBlock> </apex:page>
AND That is the controller class to the VF page:
public with sharing class LeadDuplicateController { Lead objLead; public String plainHTML { get; set; } public LeadDuplicateController(ApexPages.StandardController controller) { objLead = (Lead)controller.getRecord(); } }How to invoke the setter method of plainHTML in beforeInsert() method?
The issue I strive to solve is that beforeInsert() method is in another class.
Then call this using the zero agr method like below ..
LeadDuplicateController l = new LeadDuplicateController ();
l.plainHTML ;
Can you please explan why do you want to call the VF controller code in trigger .. if you want to reuse the code between controller and trigger use helper and handler patterns and reuse the code