You need to sign in to do that
Don't have an account?

Error while Apex class
Hi,
I am trying to call Apex Class from Trigger and getting error 'Method does not exist or incorrect signature'. How should i call constructor in Trigger.
trigger Accountrigger on Account (before update) {
if(Trigger.Isupdate && Trigger.IsBefore)
{
for (Account Acc:Trigger.new)
{
SenddataRequest();
}
}
}
Below is Apex Class
public class SenddataRequest {
public class requestWrapper
{-----Code----- }
public String GetAccounts(Account a)
{ -----Code---- }
public SenddataRequest(){
----- Code------------- }
}
}
I am trying to call Apex Class from Trigger and getting error 'Method does not exist or incorrect signature'. How should i call constructor in Trigger.
trigger Accountrigger on Account (before update) {
if(Trigger.Isupdate && Trigger.IsBefore)
{
for (Account Acc:Trigger.new)
{
SenddataRequest();
}
}
}
Below is Apex Class
public class SenddataRequest {
public class requestWrapper
{-----Code----- }
public String GetAccounts(Account a)
{ -----Code---- }
public SenddataRequest(){
----- Code------------- }
}
}
Try Below Code Please Mark it As Best Answer If It Helps
Thank You!
Please use SIngleton Design Pattern for your requirment as below:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
I have made changes and getting error in Trigger
Method is not visible: SenddataRequest.getInstance()
Please made your method public.
Please mark it as Best Answer if it helps you.
Thanks & Regards
Suraj Tripathi
Please update in Apexclass last function public instead of private
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
'Callout from triggers are currently not supported' error
When i am trying to do @future (callout=true), it's not allowing. Do you know what's best way to do @Future with Constructor.
Please mark it as Best Answer if it helps you.