function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shubham Sinha 49Shubham Sinha 49 

Getting "Method does not exist or incorrect signature: void getMDMSearchResult(String) from the type SearchPatientController"

I am calling another method of another class from another class but getting an error 'Method does not exist or incorrect signature: void getMDMSearchResult(String) from the type SearchPatientController' . not sure how to resolve it, Please help.

Parameters of the callled method :

    public List <GaineAcc> getMDMSearchResult(String searchTermFirst,String searchTermLast, String location,String recordTypeString,String email,String phone,Date birthdate,String middleName, String touchId, String hubId, String MDMId,String addstr,String zipCode, String gender){
/**
* @author: Shubham Sinha
* @date: 02/10/2020
* @description: This class is used for creating User Account and User records when a person tries to Login through Janrain
**/

Public Class BIIB_CreateAccountAndUser_Helper{
    /**
* 
* @description: Wrapper class for User and Account Creation, getting wrapper values from BIIB_ADU_Janrain_AuthProviderHandler Class

**/    
    Public class RegistrationDetails {
        
        public String firstName;
        public String lastName;
        public String fullName;
        public String email;
        public String username;
        public String locale;
        public String provider;
        Public String siteLoginUrl; 
        Public String identifier; 
        Public String link;
        Public Map<String,String> attributeMap;
        
        Public RegistrationDetails(){
            this.firstName ='';
            this.lastName ='';
            this.fullName = '';
            this.email= '';
            this.username = '';
            this.locale = '';
            this.provider ='';
            this.siteLoginUrl= '';
            this.identifier ='';
            this.link = '';
            
        }
    }
    /**
* @author: Shubham Sinha
* @description: Creates User Account and Patient therapy record.

**/
    public Static User createUserAccount(registrationDetails regDetailsWrapObj){
        Product_vod__c prodCatlog = [SELECT Name FROM Product_vod__c WHERE Name = :System.label.BIIB_Product_Aducanumab][0];
        Id recordTypeId = Schema.SObjectType.BIIB_Patient_Therapy__c.getRecordTypeInfosByName().get('AD').getRecordTypeId();
        Id recordTypeIdAccount = Schema.SObjectType.Account.getRecordTypeInfosByName().get('Patient').getRecordTypeId();
        
        List<Account> checkAccountData = [SELECT id,FirstName, LastName, PersonEmail,BIIB_PASS_Zip_Code__c FROM Account 
                                          WHERE LastName =: regDetailsWrapObj.LastName AND FirstName =:regDetailsWrapObj.FirstName
                                          AND BIIB_PASS_Zip_Code__c =:  regDetailsWrapObj.attributemap.get('ZIP')
                                           Limit 1 ];
        Account createAccount;
        if(checkAccountData.size()> 0)
        {
            createAccount = checkAccountData[0];
            BIIB_Patient_Therapy__c patTherapy = new BIIB_Patient_Therapy__c();
            patTherapy.RecordTypeId = recordTypeId;
            patTherapy.BIIB_Indication__c = System.label.BIIB_Patient_Therapy_Indication;
            patTherapy.BIIB_Therapy__c = prodCatlog.id;
            patTherapy.BIIB_Patient__c= createAccount.id;
            
            insert patTherapy;
        }
        else 
        {
      
           
            createAccount = new Account ();
            createAccount.FirstName= regDetailsWrapObj.firstName;
            createAccount.LastName =regDetailsWrapObj.lastName;
            createAccount.RecordTypeId = recordTypeIdAccount;
            insert createAccount;
 
          BIIB_Patient_Therapy__c accPatTherapy = new BIIB_Patient_Therapy__c();
            accPatTherapy.BIIB_Indication__c = System.label.BIIB_Patient_Therapy_Indication;
            accPatTherapy.BIIB_Therapy__c = prodCatlog.id;
            accPatTherapy.BIIB_Patient__c= createAccount.id;
            insert accPatTherapy;
                String searchTermFirst = regDetailsWrapObj.firstName;


              ApexPages.StandardController accStdControllerObj = new ApexPages.StandardController(new Account());
            SearchPatientController tc = new SearchPatientController(accStdControllerObj);
            tc.getMDMSearchResult( searchTermFirst); 
        }
     
        User aduUser = createAduCommunityUser(regDetailsWrapObj, createAccount.id);
        return aduUser;
Rushikesh KhandaleRushikesh Khandale
Hello,
This error is occuring because the method you are calling is expecting 14 parameters but you are passing only 1. If you dont want to pass the other parameters you can pass null values instead.
tc.getMDMSearchResult( searchTermFirst, null, null,null,null,null,null,null,null,null,null,null,null,null);

Hope this helps you
If this helps kindly mark it as solved so that it may help others in future.

Thanks and Regards