Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Jun Chen artminor

Block or report user

Report or block artminor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 4-SOQLqueries.java
@isTest (seeAllData = true)
public class SOQLqueries {
static testMethod void relationshipQueries(){
//Child-to-Parent queries are easy. Simply use the API Name of the lookup field to the parent object
//and use dot notation to specify the field on that object you want
List<Contact> conAccts = [SELECT FirstName, LastName, Account.Name FROM Contact];
//FIX ME! Use a query with a WHERE filter to only return Contacts from the Account named 'sForce'
View 3-Collections.java
@isTest
public class Collections {
static testMethod void Lists(){
//LISTS ARE AN ORDERED COLLECTION OF DATA
//How to instantiate a List with some pre-defined values
String someword = 'thread';
List<String> threeStrings = new List<String>{'rope', 'twine', someword};
//Lists have methods that allow us to evaluate or manipulate them
You can’t perform that action at this time.