Salesforce: Retrieve related list with SOQL and Apex
You are working with a Salesforce custom object, and you need to iterate through the related list. How do you retrieve the listed list with SOQL, and iterate through them with Apex? For illustration purposes, I'm going to use the Financial Force object, SCMC__Sales_Order__c. The SCMC__Sales_Order__c has a child relationship, SCMC__Purchase_Orders__r, as shown in the (Force.com IDE) screenshot below.