Skip to main content
added 33 characters in body
Source Link
Willem Mulder
  • 3.5k
  • 29
  • 51

From the comments we guess that in your code this command (or a similar command elsewhere)

PVS_Parameter_ims__c searchParam = [Select Id,End_Point_ims__c, App_ID_ims__c, Client_ID_ims__c,Client_Req_ID_ims__c,Password_ims__c,UserName_ims__c FROM PVS_Parameter_ims__c where Name='PVSLookupsPROD' ORDER By Id ]; 

returns more than 1 record, and thus it cannot store the result in this one searchParam. What you should have done instead is this:

List<PVS_Parameter_ims__c> searchParams = [Select Id,End_Point_ims__c, App_ID_ims__c, Client_ID_ims__c,Client_Req_ID_ims__c,Password_ims__c,UserName_ims__c FROM PVS_Parameter_ims__c where Name='PVSLookupsPROD' ORDER By Id ]; if (searchParams.size() > 0) { PVS_Parameter_ims__c searchParam = searchParams.get(0); } 

From the comments we guess that in your code this command

PVS_Parameter_ims__c searchParam = [Select Id,End_Point_ims__c, App_ID_ims__c, Client_ID_ims__c,Client_Req_ID_ims__c,Password_ims__c,UserName_ims__c FROM PVS_Parameter_ims__c where Name='PVSLookupsPROD' ORDER By Id ]; 

returns more than 1 record, and thus it cannot store the result in this one searchParam. What you should have done instead is this:

List<PVS_Parameter_ims__c> searchParams = [Select Id,End_Point_ims__c, App_ID_ims__c, Client_ID_ims__c,Client_Req_ID_ims__c,Password_ims__c,UserName_ims__c FROM PVS_Parameter_ims__c where Name='PVSLookupsPROD' ORDER By Id ]; if (searchParams.size() > 0) { PVS_Parameter_ims__c searchParam = searchParams.get(0); } 

From the comments we guess that in your code this command (or a similar command elsewhere)

PVS_Parameter_ims__c searchParam = [Select Id,End_Point_ims__c, App_ID_ims__c, Client_ID_ims__c,Client_Req_ID_ims__c,Password_ims__c,UserName_ims__c FROM PVS_Parameter_ims__c where Name='PVSLookupsPROD' ORDER By Id ]; 

returns more than 1 record, and thus it cannot store the result in this one searchParam. What you should have done instead is this:

List<PVS_Parameter_ims__c> searchParams = [Select Id,End_Point_ims__c, App_ID_ims__c, Client_ID_ims__c,Client_Req_ID_ims__c,Password_ims__c,UserName_ims__c FROM PVS_Parameter_ims__c where Name='PVSLookupsPROD' ORDER By Id ]; if (searchParams.size() > 0) { PVS_Parameter_ims__c searchParam = searchParams.get(0); } 
Source Link
Willem Mulder
  • 3.5k
  • 29
  • 51

From the comments we guess that in your code this command

PVS_Parameter_ims__c searchParam = [Select Id,End_Point_ims__c, App_ID_ims__c, Client_ID_ims__c,Client_Req_ID_ims__c,Password_ims__c,UserName_ims__c FROM PVS_Parameter_ims__c where Name='PVSLookupsPROD' ORDER By Id ]; 

returns more than 1 record, and thus it cannot store the result in this one searchParam. What you should have done instead is this:

List<PVS_Parameter_ims__c> searchParams = [Select Id,End_Point_ims__c, App_ID_ims__c, Client_ID_ims__c,Client_Req_ID_ims__c,Password_ims__c,UserName_ims__c FROM PVS_Parameter_ims__c where Name='PVSLookupsPROD' ORDER By Id ]; if (searchParams.size() > 0) { PVS_Parameter_ims__c searchParam = searchParams.get(0); }