You need to sign in to do that
Don't have an account?
How to reference a global method
global class Recruitement_Dashboard_Controller{ private List<table> invitetracking; public Recruitement_Dashboard_Controller(ApexPages.StandardController controller) { invitetracking = [SELECT Id FROM table];system.debug('invitetracking: '+invitetracking); } //Global Counts****************************************************************************************************************// Public Integer getAcceptedMemberCount(){ Integer counter = 0; for(Invite_Tracking__c it : invitetracking){ if(field == 'text' && field == '1') counter += field.intValue();} system.debug('counter: '+counter); return counter; }
global class Recruitement_Dashboard_Controller2{ Public Integer test(){ Recruitement_Dashboard_Controller.getAcceptedMemberCount(); } }
Thanks for the reply!
I did try that, but still the same results :(
Do you get any compile errors compiling your Recruitement_Dashboard_Controller?
When I paste it into my dev org, I get:
sObject type 'table' not supported.
I can compile successfully, i changed the actual table names in my class to table, you will need to change on your side to tables in your org.
e.g.
table = Account
field = AccountName
Ah - suddenly the mists clear.
You are attempting to invoke the method from the Recruitement_Dashboard_Controller class - as the method is not static, it isn't available.