function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Hi @kallam salesforce1,
You are using recordResults variable which is of non-static type inside the static method -CreateAcc.
So, you have to just add the static keyword in the declaration of recordResults variable.
i.e---> public static string recordResults {get;set;}
Let me know if this was helpful. If it does, please mark it as Best Answer to help others too.Thanks,Shubham Raj
public class CreateNewAccountRecordHandler { public static string recordResults{get; set;} public static void CreateAcc(){ Account acc = new Account(); acc.Name = 'ABC'; acc.Industry = 'Banking'; acc.Phone = '1234'; insert acc; if(acc.Id != null){ CreateNewAccountRecordHandler.recordResults = 'Inserted Successfully '+acc.Id; } else{ CreateNewAccountRecordHandler.recordResults = 'Not inserted '; } } }
Hi @Kallam salesforce1,
Hope your issue has been resolved and please mark it as Best Answer and close the Ticket.ThanksShubham Raj
Hi @kallam salesforce1,
You are using recordResults variable which is of non-static type inside the static method -CreateAcc.
So, you have to just add the static keyword in the declaration of recordResults variable.
i.e---> public static string recordResults {get;set;}
Let me know if this was helpful. If it does, please mark it as Best Answer to help others too.
Thanks,
Shubham Raj
All Answers
Hi @kallam salesforce1,
You are using recordResults variable which is of non-static type inside the static method -CreateAcc.
So, you have to just add the static keyword in the declaration of recordResults variable.
i.e---> public static string recordResults {get;set;}
Let me know if this was helpful. If it does, please mark it as Best Answer to help others too.
Thanks,
Shubham Raj
If you found this helpful,
Please mark it as the best answer.
Regards
Suraj Tripathi
Hi @Kallam salesforce1,
Hope your issue has been resolved and please mark it as Best Answer and close the Ticket.
Thanks
Shubham Raj