I have some logic where I need to iterate thru a bunch of Opportunities. I need to be able to determine when I hit a new Opportunity Owner ID.
I try:
String lastownerId = '';
for (Opportunity opportunity: opportunities) {
if(opportunity.OwnerId == (lastownerId)) {
...
...
I get: System.StringException: Invalid id:
any tips?