You need to sign in to do that
Don't have an account?
chikku
Method does not exist or incorrect signature: void getById() from the type IController
IController Transloan=new LoanController();
Loan__c tloan=new Loan__c();
sObj=(Loan_Transaction__c)obj;
tobj.Related_Object_Name__c='Loan_Transaction__c';
tloan=(Loan__c)Transloan.getById();
if(tloan.Account__c!=null){
tobj.Object_Id__c=tloan.Account__c;
}
else{
tobj.Object_Id__c=tloan.Contact__c;
}
Loan__c tloan=new Loan__c();
sObj=(Loan_Transaction__c)obj;
tobj.Related_Object_Name__c='Loan_Transaction__c';
tloan=(Loan__c)Transloan.getById();
if(tloan.Account__c!=null){
tobj.Object_Id__c=tloan.Account__c;
}
else{
tobj.Object_Id__c=tloan.Contact__c;
}
I noticed there are other issues in the code.
You define local variable tloan at line 2:
Loan__c tloan=new Loan__c();
But at line 5, you are trying to cast an ID (transload.getbyId()) to Loan__c.
tloan=(Loan__c)Transloan.getById();
tloan.Account__c = tloan.accountId; //assume there is property accountId in LoadController class.
tloan.otherfield__c = tloan.otherfield;