+ Start a Discussion
S RAHMATHULLAS RAHMATHULLA 

Errror:Invalid bind expression type of List<Id> for column of type Id. Please help me for the below?

this is my first map
 Map < string,List < Id > > finalEmailSoinvIdMap = new Map < string,List < Id > >();
Map < Id,rstk__soconpbill__c > contractPeriodcBillingRecord = new Map < Id,rstk__soconpbill__c >([SELECT Id,rstk__soconpbill_soinv__c FROM rstk__soconpbill__c WHERE rstk__soconpbill_soinv__c IN:finalEmailSoinvIdMap.values()]);

what is wrong in this? Please help
Errror:Invalid bind expression type of List<Id> for column of type Id
Temoc MunozTemoc Munoz
Hi S.

You will need to pre-populate your ids differently:
 
// Modify your logic accordingly
List<Id> myIds = new List<Id>();
......
​
Map < Id,rstk__soconpbill__c > contractPeriodcBillingRecord = new Map < Id,rstk__soconpbill__c >([SELECT Id,rstk__soconpbill_soinv__c FROM rstk__soconpbill__c WHERE rstk__soconpbill_soinv__c IN:myIds]);


When you use the IN clause, see it this way:  IN ('0001', '0002') as you can see this is a list of values.

In your case, you have IN (List{....}, List{...}), so Apex does not understand a List of values as is expecting a single value already. This is done automatically when your values are in a List or Set.

Thanks

Temo