O'Reilly logo

The Developer’s Guide to the Force.com Platform by Phil Choi, Andrew Fawcett, Glen Martin, Rick Greenwald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Loading the Position

Once the required information is extracted from the incoming email, additional Apex code handles the next task of reading the Position record for the job application being processed. The SOQL query for the record retrieval is wrapped within a try/catch block to handle the circumstance where the Position record is not found. If the Position record is not located, the resulting DmlException is caught and a new exception is thrown with text explaining the issue to the user.

// Resolve the Id of the Position they are applying for Id positionId; try { // Lookup the Position they are applying for by name Position__c position = [select Id from Position__c where name = :positionName limit 1]; positionId = position.Id; } catch (Exception ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required