Skip to main content
added 7 characters in body
Source Link
Eric
  • 54.4k
  • 11
  • 104
  • 196

Change:

If(AccredList.size()>0)

    return 'Opportunity Number is ' + AccredList; 

To something like:

If(AccredList.size()>0){

    return 'Opportunity Number is ' + AccredList;AccredList.size(); 
}

return 'No Opportunity Found'; //or similar

The way you currently have it if the IF condition is not met then there would be no return

Change:

If(AccredList.size()>0)

    return 'Opportunity Number is ' + AccredList; 

To something like:

If(AccredList.size()>0){

    return 'Opportunity Number is ' + AccredList; 
}

return 'No Opportunity Found'; //or similar

The way you currently have it if the IF condition is not met then there would be no return

Change:

If(AccredList.size()>0)

    return 'Opportunity Number is ' + AccredList; 

To something like:

If(AccredList.size()>0){

    return 'Opportunity Number is ' + AccredList.size(); 
}

return 'No Opportunity Found'; //or similar

The way you currently have it if the IF condition is not met then there would be no return

Source Link
Eric
  • 54.4k
  • 11
  • 104
  • 196

Change:

If(AccredList.size()>0)

    return 'Opportunity Number is ' + AccredList; 

To something like:

If(AccredList.size()>0){

    return 'Opportunity Number is ' + AccredList; 
}

return 'No Opportunity Found'; //or similar

The way you currently have it if the IF condition is not met then there would be no return