• Hardik B
  • NEWBIE
  • 0 Points
  • Member since 2017
  • Salesforce Developer

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

Can anyone tell me, how to use the Column Function in apex class ?

I have no idea how that works. 

Thank you all in advance.
Hello All,

I've a situation when calculation compound interest on monthly basis. I'm using the formula provided by the Salesforce for Compound Interest but it throws me an error. Here is the execute anon code snippet I'm trying first to figure out if I'm getting the proper output or not:

Integer mic= 50000;
Decimal int_rate= 9.5;
Integer tenure= 4;

Decimal emi= mic*(1+int_rate/12)^(tenure*12);

system.debug('Compound Interest=' +emi.round());

This is Error I'm getting: Line: 5, Column: 14
^ operator can only be applied to Boolean expressions or to Integer or Long expressions

I want to calculate montly emi so I'm using the compound interest for a specific tenure of period.

Why am I seeing this error I dont know can anyone please help me out with this ?


Help will be really appreciated.

Regards,
Hardik B.

 
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.
Hello All, 

Can anyone tell me, how to use the Column Function in apex class ?

I have no idea how that works. 

Thank you all in advance.
Hello All,

I've a situation when calculation compound interest on monthly basis. I'm using the formula provided by the Salesforce for Compound Interest but it throws me an error. Here is the execute anon code snippet I'm trying first to figure out if I'm getting the proper output or not:

Integer mic= 50000;
Decimal int_rate= 9.5;
Integer tenure= 4;

Decimal emi= mic*(1+int_rate/12)^(tenure*12);

system.debug('Compound Interest=' +emi.round());

This is Error I'm getting: Line: 5, Column: 14
^ operator can only be applied to Boolean expressions or to Integer or Long expressions

I want to calculate montly emi so I'm using the compound interest for a specific tenure of period.

Why am I seeing this error I dont know can anyone please help me out with this ?


Help will be really appreciated.

Regards,
Hardik B.

 
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.