Hot answers tagged

1 vote
Accepted

Querying CampaignMembers based on Lead fields

At first glance, your code is a lot more work than it needs to be. If we use Trigger.newMap instead of Trigger.new, we don't need the partners map. Consequently, we can dramatically reduce your code ...
sfdcfox's user avatar
  • 481k
1 vote

Unexpected Tokens on Test Class for Apex Trigger: What am I doing wrong to create a test class for this Trigger trying to deploy to Production?

You can't mix trigger code and unit test code into a single file. The "unexpected tokens" error comes from the fact that two files were apparently mixed together. You should have at least ...
sfdcfox's user avatar
  • 481k

Only top scored, non community-wiki answers of a minimum length are eligible