• Expert Summit
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hello All, 

I'm trying to wrtie this @RemoteAction  code but due to certain errors and problems, I'm not able to complete the code. 
Error 1: Comparison arguments must be compatible types: Map<String,String>, String: Line 18
Error 2: Illegal conversion from List<Map<String,String>> to String: Line 39


Here's the preview of my code:

// Get the Finance Calculation for the page 
global with sharing class FinanceRemoter {

    public Map<String, String> emiCal {get; set;}
    public static list<jud_new_cars_list__c> ncl {get; set;}
    public static list<jud_new_cars_pricing__c> ncp {get; set;}
    public static list<jud_model_colour__c> mc {get; set;}
    public FinanceRemoter(){ }
    
    @RemoteAction
    global static String financeSearch(Map<String, String> emiCal){
        
        Set<ID> nclList = new Set<ID>();
        list<jud_new_cars_list__c> retCarList = new list<jud_new_cars_list__c>();
      
       List<Map<String, String>> carList = new List<Map<String, String>>();
        
        if (emiCal != ''){
            
            List<jud_new_cars_pricing__c> jncp = [SELECT Id, Name, downpayment__c, emi1__c, emi2__c, product_id__c, product_id__r.Id
                                               FROM jud_new_cars_pricing__c
                                               WHERE product_id__r.Name
                                               LIKE: (emiCal+'%')];
            
            for(jud_new_cars_pricing__c jncpList : jncp){
                if(jncpList.product_id__c != null) {
                    nclList.add((Id)jncpList.product_id__c);
                    
                    System.debug('Matching Product Id ===>' +nclList);
                    
     List<jud_new_cars_list__c> newcarList = [SELECT Id, Name, model__c, submodel__c, engine__c, variant__c, fuel_type__c, seat__c
                                           FROM jud_new_cars_list__c
                                           WHERE id IN: nclList];
                    
                    }
                    nclList.clear();
                } 
            }
            return carList;
        }
    }    

Can anyone please help me out where I'm going wrong. Please It will be really very helpful.

Regards,
HB.