You need to sign in to do that
Don't have an account?

illegal assignment from list to list
global void execute(Database.BatchableContext BC, List Parlist) {
if(Parlist != null && !Parlist.isEmpty())
{
Map maprecTypewithId = new Map();
List listPARToUpdate = [select id,Name from recordType where SObjectType = 'Price_Authorization_Request__c'];
for(RecordType rec : listPARToUpdate )
{
maprecTypewithId.put(rec.Name,rec.id);
}
How can I avoid my illegal assignment of lists? Also, where would I specify a batchable size of 190?
if(Parlist != null && !Parlist.isEmpty())
{
Map maprecTypewithId = new Map();
List listPARToUpdate = [select id,Name from recordType where SObjectType = 'Price_Authorization_Request__c'];
for(RecordType rec : listPARToUpdate )
{
maprecTypewithId.put(rec.Name,rec.id);
}
How can I avoid my illegal assignment of lists? Also, where would I specify a batchable size of 190?
All Answers
Your are defining list and map in a wrong manner so update your code as below. And for creating and executing batch classes please refer this link (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_batch_interface.htm).
[If you got answer from my post please mark it as solution.]
Thanks,
Kapil
(forcecube@gmail.com)
Although name shouldn't be cause of the error but you can use developername instead. Please try this. Let me know if problem still persists.
Thanks,
Kapil
(forcecube@gmail.com)