This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "gender": "male", | |
| "name": { | |
| "title": "mr", | |
| "first": "aiden", | |
| "last": "lucas" | |
| }, | |
| "location": { | |
| "street": "1446 oak lawn ave", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action('admin_menu', 'test_plugin_setup_menu'); | |
| function test_plugin_setup_menu(){ | |
| add_menu_page( 'Shoppers Mag CSV Import Page', 'Shoppers Mag CSV Import', 'manage_options', 'csv-import', 'test_init', "dashicons-image-rotate-right",2 ); | |
| } | |
| function test_init(){ | |
| test_handle_post(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trigger AccountAddressTrigger on Account (before insert, before update) { | |
| for(Account a : Trigger.new){ | |
| If (a.Match_Billing_Address__c == true && a.BillingPostalCode!=Null) { | |
| a.ShippingPostalCode = a.BillingPostalCode; | |
| System.debug('ShippingPostalCode: '+a.ShippingPostalCode); | |
| System.debug('BillingPostalCode: '+a.BillingPostalCode); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class StringArrayTest { | |
| public static String[] generateStringArray(Integer numOfStrings) { | |
| // Create a generateStringArray object | |
| String[] stringArr = new List<String>(); | |
| for(Integer i=0;i<numOfStrings;i++) { | |
| stringArr.add('Test '+i); | |
| } | |
| return stringArr; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AccountHandler { | |
| public static Account insertNewAccount(String accountName){ | |
| try{ | |
| Account acct = new Account(Name=accountName); | |
| insert acct; | |
| return acct; | |
| } | |
| catch (DmlException e){ | |
| System.debug('A DML exception has ocurred: ' + e.getMessage()); | |
| return (NULL); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ContactSearch { | |
| public static Contact[] searchForContacts(String lastName, String postCode){ | |
| Contact[] cts = [SELECT Contact.ID,Contact.Name FROM Contact | |
| WHERE LastName = :lastName AND MailingPostalCode= :postCode]; | |
| return cts; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ContactAndLeadSearch { | |
| public static List<List<SObject>> searchContactsAndLeads(String lastName){ | |
| List<List<SObject>> searchList = [FIND :lastName IN ALL FIELDS | |
| RETURNING Lead(Name), Contact(FirstName,LastName)]; | |
| Lead[] searchLead = (Lead[])searchList[0]; | |
| Contact[] searchContacts = (Contact[])searchList[1]; | |
| System.debug('Found the following leads.'); | |
| for (Lead a : searchLead) { | |
| System.debug(a.Name); | |
| } |