├── Classes ├── ParkLocator ├── TestRestrictContactByName ├── AnimalLocatorTest ├── DailyLeadProcessor ├── AnimalLocatorMock ├── RandomContactFactory ├── ParkLocatorTest ├── AccountManager ├── TestVerifyDate ├── AccountProcessorTest ├── AccountProcessor ├── AddPrimaryContact ├── AccountManagerTest ├── ParkServiceMock ├── DailyLeadProcessorTest ├── AddPrimaryContactTest ├── AnimalLocator ├── MaintenanceRequestHelper └── ParkService ├── sfdx-project.json ├── scripts ├── soql │ └── account.soql └── apex │ └── hello.apex ├── Triggers ├── AccountAddressTrigger ├── ClosedOpportunityTrigger └── MaintenanceRequest ├── force-app └── main │ └── default │ └── lwc │ └── jsconfig.json ├── config └── project-scratch-def.json ├── package.json └── README.md /Classes/ParkLocator: -------------------------------------------------------------------------------- 1 | public class ParkLocator { 2 | public static list country(String y) { 3 | ParkService.ParksImplPort parks = 4 | new ParkService.ParksImplPort(); 5 | return parks.byCountry(y); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /sfdx-project.json: -------------------------------------------------------------------------------- 1 | { 2 | "packageDirectories": [ 3 | { 4 | "path": "force-app", 5 | "default": true 6 | } 7 | ], 8 | "namespace": "", 9 | "sfdcLoginUrl": "https://login.salesforce.com", 10 | "sourceApiVersion": "49.0" 11 | } 12 | -------------------------------------------------------------------------------- /scripts/soql/account.soql: -------------------------------------------------------------------------------- 1 | // Use .soql files to store SOQL queries. 2 | // You can execute queries in VS Code by selecting the 3 | // query text and running the command: 4 | // SFDX: Execute SOQL Query with Currently Selected Text 5 | 6 | SELECT Id, Name FROM Account 7 | -------------------------------------------------------------------------------- /Classes/TestRestrictContactByName: -------------------------------------------------------------------------------- 1 | @isTest 2 | public class TestRestrictContactByName { 3 | @isTest static void testmethod1(){ 4 | //insert contact that will cause trigger to fire. 5 | Contact C1 = new Contact(lastName = 'INVALIDNAME'); 6 | insert C1; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Triggers/AccountAddressTrigger: -------------------------------------------------------------------------------- 1 | trigger AccountAddressTrigger on Account (before insert, before update) { 2 | for (Account A: trigger.new){ 3 | if (A.BillingPostalCode != null && A.Match_Billing_Address__c == true){ 4 | A.ShippingPostalCode = A.BillingPostalCode; 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Classes/AnimalLocatorTest: -------------------------------------------------------------------------------- 1 | @IsTest 2 | public class AnimalLocatorTest { 3 | @isTest 4 | public static void testAnimalLocator() { 5 | Test.setMock(HttpCalloutMock.class, new AnimalLocatorMock()); 6 | String s = AnimalLocator.getAnimalNameById(1); 7 | system.debug('string returned: ' + s); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /Classes/DailyLeadProcessor: -------------------------------------------------------------------------------- 1 | global class DailyLeadProcessor implements Schedulable{ 2 | global void execute(SchedulableContext ctx) { 3 | List Leads = [SELECT Id, leadsource 4 | FROM Lead 5 | WHERE leadsource = null limit 200]; 6 | 7 | For (lead L :leads){ 8 | L.LeadSource = 'Dreamforce'; 9 | } 10 | update leads; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Classes/AnimalLocatorMock: -------------------------------------------------------------------------------- 1 | @IsTest 2 | global class AnimalLocatorMock implements HttpCalloutMock { 3 | 4 | global HTTPresponse respond(HTTPrequest request) { 5 | Httpresponse response = new Httpresponse(); 6 | response.setStatusCode(200); 7 | response.setBody('{"animal":{"id":1,"name":"chicken","eats":"chicken food","says":"cluck cluck"}}'); 8 | return response; 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /force-app/main/default/lwc/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "experimentalDecorators": true 4 | }, 5 | "include": [ 6 | "**/*", 7 | "../../../../.sfdx/typings/lwc/**/*.d.ts" 8 | ], 9 | "paths": { 10 | "c/*": [ 11 | "*" 12 | ] 13 | }, 14 | "typeAcquisition": { 15 | "include": [ 16 | "jest" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Triggers/ClosedOpportunityTrigger: -------------------------------------------------------------------------------- 1 | trigger ClosedOpportunityTrigger on Opportunity (after insert, after update) { 2 | List taskList = new List(); 3 | for (Opportunity O :trigger.new){ 4 | if (O.StageName == 'Closed Won'){ 5 | taskList.add(new Task(Subject='Follow Up Test Task',WhatId = O.Id)); 6 | } 7 | } 8 | if (taskList.size() > 0){ 9 | Insert taskList; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /config/project-scratch-def.json: -------------------------------------------------------------------------------- 1 | { 2 | "orgName": "lhartley company", 3 | "edition": "Developer", 4 | "features": [], 5 | "settings": { 6 | "lightningExperienceSettings": { 7 | "enableS1DesktopEnabled": true 8 | }, 9 | "securitySettings": { 10 | "passwordPolicies": { 11 | "enableSetPasswordInApi": true 12 | } 13 | }, 14 | "mobileSettings": { 15 | "enableS1EncryptedStoragePref2": false 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Classes/RandomContactFactory: -------------------------------------------------------------------------------- 1 | public class RandomContactFactory { 2 | public static List generateRandomContacts(Integer numContacts, String Last) { 3 | List contacts = new List(); 4 | 5 | for(Integer i=0;i result = ParkLocator.country(x); 9 | // Verify that a fake result is returned 10 | System.debug(result); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Classes/AccountManager: -------------------------------------------------------------------------------- 1 | @RestResource(urlMapping='/Accounts/*/contacts') 2 | global class AccountManager { 3 | @HttpGet 4 | global static Account getAccount(){ 5 | RestRequest request = RestContext.request; 6 | 7 | String accountID = request.requestURI.substringBetween('Accounts/','/contacts'); 8 | 9 | Account Result = [Select id, Name, (select ID, Name From Contacts) from Account where ID = :accountID]; 10 | 11 | Return Result; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Triggers/MaintenanceRequest: -------------------------------------------------------------------------------- 1 | trigger MaintenanceRequest on Case (after update) { 2 | List CasesToUpdate = new List(); 3 | for (Case request :Trigger.New){ 4 | if(Trigger.oldMap.get(request.Id).Status!='Closed'&& request.Status=='Closed'){ 5 | if(request.Type=='Routine Maintenance'||request.Type=='Repair'){ 6 | CasesToUpdate.add(request.Id); 7 | } 8 | } 9 | } 10 | MaintenanceRequestHelper.updateWorkOrders(CasesToUpdate); 11 | } 12 | -------------------------------------------------------------------------------- /Classes/TestVerifyDate: -------------------------------------------------------------------------------- 1 | @isTest 2 | public class TestVerifyDate { 3 | @isTest static void testCheckDates(){ 4 | Date date1 = Date.valueOf('2018-11-2'); 5 | Date date2 = Date.valueOf('2018-11-10'); 6 | Date resultDate = VerifyDate.CheckDates(date1,date2); 7 | System.assertEquals(Date.valueOf('2018-11-10'), resultDate); 8 | Date date3 = Date.valueOf('2018-12-10'); 9 | resultDate = VerifyDate.CheckDates(date1, date3); 10 | System.assertEquals(Date.valueOf('2018-11-30'),resultDate); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Classes/AccountProcessorTest: -------------------------------------------------------------------------------- 1 | @IsTest 2 | private class AccountProcessorTest { 3 | @IsTest 4 | private static void testFunction(){ 5 | Account A1 = new Account(); 6 | A1.Name = 'testaccount1'; 7 | Insert A1; 8 | Contact C1 = new contact(); 9 | C1.LastName = 'testContact1'; 10 | C1.AccountId = A1.Id; 11 | Insert C1; 12 | List acctIDs = new List(); 13 | acctIds.add(A1.Id); 14 | Test.startTest(); 15 | AccountProcessor.countContacts(acctIds); 16 | Test.stopTest(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Classes/AccountProcessor: -------------------------------------------------------------------------------- 1 | public class AccountProcessor { 2 | @future 3 | public static void countContacts(list AccountIds){ 4 | 5 | List Accounts = [select id, Number_of_contacts__c from Account where ID in :AccountIds]; 6 | List AccountsToUpdate = new List(); 7 | For (Account acct :Accounts){ 8 | acct.Number_of_contacts__c = [select count() from Contact where AccountId =:acct.id ]; 9 | 10 | AccountsToUpdate.add(acct); 11 | } 12 | update AccountsToUpdate; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Classes/AddPrimaryContact: -------------------------------------------------------------------------------- 1 | public class AddPrimaryContact implements Queueable{ 2 | private Contact cont; 3 | private String State; 4 | public AddPrimaryContact(Contact cont, String State) { 5 | this.Cont = cont; 6 | this.State = State; 7 | } 8 | public void execute(QueueableContext context) { 9 | ListAccounts = [select ID from Account where BillingState =: State limit 200]; 10 | For (Account A : Accounts){ 11 | Contact clonedCont = cont.clone(false,false,false,false); 12 | insert clonedCont; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Classes/AccountManagerTest: -------------------------------------------------------------------------------- 1 | @isTest 2 | public class AccountManagerTest { 3 | static testMethod void testFuncionality(){ 4 | Account A1 = new Account(Name='AccountOne'); 5 | insert A1; 6 | Contact C1 = new Contact(LastName = 'ContactOne',AccountID=A1.id); 7 | insert C1; 8 | ID accountID = A1.id; 9 | RestRequest request = new RestRequest(); 10 | request.requestURI = 'https://cunning-bear-hmmt9x-dev-ed.my.salesforce.com/services/apexrest/Accounts/' + accountID + '/contacts'; 11 | request.httpMethod = 'Get'; 12 | RestContext.request = request; 13 | Account thisAccount = AccountManager.getAccount(); 14 | system.debug(thisAccount); 15 | system.debug(thisAccount.contacts); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Classes/ParkServiceMock: -------------------------------------------------------------------------------- 1 | @isTest 2 | global class ParkServiceMock implements WebServiceMock { 3 | global void doInvoke( 4 | Object stub, 5 | Object request, 6 | Map response, 7 | String endpoint, 8 | String soapAction, 9 | String requestName, 10 | String responseNS, 11 | String responseName, 12 | String responseType) { 13 | // start - specify the response you want to send 14 | ParkService.byCountryResponse response_x = 15 | new ParkService.byCountryResponse(); 16 | response_x.return_x = new List{'ensign','mikat'}; 17 | 18 | // end 19 | response.put('response_x', response_x); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Classes/DailyLeadProcessorTest: -------------------------------------------------------------------------------- 1 | @isTest 2 | public class DailyLeadProcessorTest { 3 | public static String Cron_exp = '0 0 0 15 3 ? 2022'; 4 | static testmethod void test_leadProcessor() { 5 | List Leads = new List(); 6 | for (Integer i=0; i< 200; i++){ 7 | lead L = new Lead(Lastname='TestLead '+i,Company='testcompany'); 8 | leads.add(L); 9 | } 10 | Insert leads; 11 | test.startTest(); 12 | String jobid = System.schedule('schedApexTest',Cron_exp,new DailyLeadProcessor()); 13 | Test.stopTest(); 14 | 15 | //check that all leads were updated 16 | List LL = [select id from Lead where leadsource = 'Dreamforce']; 17 | system.assertEquals(leads.size(),LL.size(),'Leads were not updated'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Classes/AddPrimaryContactTest: -------------------------------------------------------------------------------- 1 | @isTest 2 | public class AddPrimaryContactTest { 3 | @testSetup 4 | static void setup() { 5 | List Accounts = new List(); 6 | for (Integer i = 0; i < 50; i++){ 7 | accounts.add(new Account(name='TestAccountNY'+i,BillingState='NY')); 8 | } 9 | for (Integer i = 0; i < 50; i++){ 10 | accounts.add(new Account(name='TestAccountCA'+i,BillingState='CA')); 11 | } 12 | Insert Accounts; 13 | } 14 | 15 | static testmethod void testQueueable() { 16 | Contact C1 = new Contact(lastName='testguy'); 17 | Insert C1; 18 | 19 | AddPrimaryContact updater = new AddPrimaryContact(C1,'CA'); 20 | test.startTest(); 21 | System.enqueueJob(updater); 22 | test.stopTest(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Classes/AnimalLocator: -------------------------------------------------------------------------------- 1 | public class AnimalLocator { 2 | public class cls_animal { 3 | public Integer id; 4 | public String name; 5 | public String eats; 6 | public String says; 7 | } 8 | public class JSONOutput{ 9 | public cls_animal animal; 10 | } 11 | 12 | public static String getAnimalNameById (Integer id) { 13 | Http http = new Http(); 14 | HttpRequest request = new HttpRequest(); 15 | request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals/' + id); 16 | request.setMethod('GET'); 17 | HttpResponse response = http.send(request); 18 | system.debug('response: ' + response.getBody()); 19 | jsonOutput results = (jsonOutput) JSON.deserialize(response.getBody(), jsonOutput.class); 20 | system.debug('results= ' + results.animal.name); 21 | return(results.animal.name); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "salesforce-app", 3 | "private": true, 4 | "version": "1.0.0", 5 | "description": "Salesforce App", 6 | "scripts": { 7 | "lint": "npm run lint:lwc && npm run lint:aura", 8 | "lint:aura": "eslint **/aura/**", 9 | "lint:lwc": "eslint **/lwc/**", 10 | "test": "npm run test:unit", 11 | "test:unit": "sfdx-lwc-jest", 12 | "test:unit:watch": "sfdx-lwc-jest --watch", 13 | "test:unit:debug": "sfdx-lwc-jest --debug", 14 | "test:unit:coverage": "sfdx-lwc-jest --coverage", 15 | "prettier": "prettier --write \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"", 16 | "prettier:verify": "prettier --list-different \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"" 17 | }, 18 | "devDependencies": { 19 | "@prettier/plugin-xml": "^0.10.0", 20 | "@salesforce/eslint-config-lwc": "^0.7.0", 21 | "@salesforce/eslint-plugin-aura": "^1.4.0", 22 | "@salesforce/sfdx-lwc-jest": "^0.9.2", 23 | "eslint": "^7.6.0", 24 | "eslint-config-prettier": "^6.11.0", 25 | "husky": "^4.2.1", 26 | "lint-staged": "^10.0.7", 27 | "prettier": "^2.0.5", 28 | "prettier-plugin-apex": "^1.6.0" 29 | }, 30 | "husky": { 31 | "hooks": { 32 | "pre-commit": "lint-staged" 33 | } 34 | }, 35 | "lint-staged": { 36 | "**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}": [ 37 | "prettier --write" 38 | ], 39 | "**/{aura|lwc}/**": [ 40 | "eslint" 41 | ] 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Classes/MaintenanceRequestHelper: -------------------------------------------------------------------------------- 1 | public class MaintenanceRequestHelper { 2 | 3 | public static void updateWorkOrders(List requests){ 4 | List RequestsToInsert = new List(); 5 | List CasesToUpdate = [Select Id, Equipment__c, Vehicle__c, Equipment__r.Maintenance_Cycle__c, 6 | Origin, ContactId,CaseNumber, 7 | (Select Equipment__r.Maintenance_Cycle__c from Work_Parts__r) from Case 8 | where Id in: requests]; 9 | for (case c :CasesToUpdate){ 10 | Case newCase = new Case(); 11 | Decimal serviceDays = MaintenancePeriod(c); 12 | newCase.Type = 'Routine Maintenance'; 13 | newCase.Status = 'New'; 14 | newCase.Origin = c.Origin; 15 | newCase.ContactId = c.ContactId; 16 | newCase.Equipment__c = c.Equipment__c; 17 | newCase.Vehicle__c = c.Vehicle__c; 18 | newCase.Subject = 'Maintenance Followup'; 19 | newCase.Date_Reported__c = Date.today(); 20 | newCase.Date_Due__c = Date.today().addDays(Integer.valueOf(serviceDays)); 21 | RequestsToInsert.add(newCase); 22 | } 23 | insert RequestsToInsert; 24 | } 25 | 26 | private static Decimal MaintenancePeriod(Case request){ 27 | Decimal X; 28 | system.debug('MR#: '+request.CaseNumber ); 29 | system.debug('WPs: '+request.Work_Parts__r.size()); 30 | if (request.Work_Parts__r.size()>0){ 31 | X = request.Work_Parts__r.get(0).Equipment__r.Maintenance_Cycle__c; 32 | for (Work_Part__c wp : request.Work_Parts__r){ 33 | if (wp.Equipment__r.Maintenance_Cycle__c < X){ 34 | X = wp.Equipment__r.Maintenance_Cycle__c; 35 | } 36 | } 37 | } else { 38 | X = 365; 39 | } 40 | return X; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Classes/ParkService: -------------------------------------------------------------------------------- 1 | //Generated by wsdl2apex 2 | 3 | public class ParkService { 4 | public class byCountryResponse { 5 | public String[] return_x; 6 | private String[] return_x_type_info = new String[]{'return','http://parks.services/',null,'0','-1','false'}; 7 | private String[] apex_schema_type_info = new String[]{'http://parks.services/','false','false'}; 8 | private String[] field_order_type_info = new String[]{'return_x'}; 9 | } 10 | public class byCountry { 11 | public String arg0; 12 | private String[] arg0_type_info = new String[]{'arg0','http://parks.services/',null,'0','1','false'}; 13 | private String[] apex_schema_type_info = new String[]{'http://parks.services/','false','false'}; 14 | private String[] field_order_type_info = new String[]{'arg0'}; 15 | } 16 | public class ParksImplPort { 17 | public String endpoint_x = 'https://th-apex-soap-service.herokuapp.com/service/parks'; 18 | public Map inputHttpHeaders_x; 19 | public Map outputHttpHeaders_x; 20 | public String clientCertName_x; 21 | public String clientCert_x; 22 | public String clientCertPasswd_x; 23 | public Integer timeout_x; 24 | private String[] ns_map_type_info = new String[]{'http://parks.services/', 'ParkService'}; 25 | public String[] byCountry(String arg0) { 26 | ParkService.byCountry request_x = new ParkService.byCountry(); 27 | request_x.arg0 = arg0; 28 | ParkService.byCountryResponse response_x; 29 | Map response_map_x = new Map(); 30 | response_map_x.put('response_x', response_x); 31 | WebServiceCallout.invoke( 32 | this, 33 | request_x, 34 | response_map_x, 35 | new String[]{endpoint_x, 36 | '', 37 | 'http://parks.services/', 38 | 'byCountry', 39 | 'http://parks.services/', 40 | 'byCountryResponse', 41 | 'ParkService.byCountryResponse'} 42 | ); 43 | response_x = response_map_x.get('response_x'); 44 | return response_x.return_x; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Salesforce App 2 | 3 | This guide helps Salesforce developers who are new to Visual Studio Code go from zero to a deployed app using Salesforce Extensions for VS Code and Salesforce CLI. 4 | 5 | ## Part 1: Choosing a Development Model 6 | 7 | There are two types of developer processes or models supported in Salesforce Extensions for VS Code and Salesforce CLI. These models are explained below. Each model offers pros and cons and is fully supported. 8 | 9 | ### Package Development Model 10 | 11 | The package development model allows you to create self-contained applications or libraries that are deployed to your org as a single package. These packages are typically developed against source-tracked orgs called scratch orgs. This development model is geared toward a more modern type of software development process that uses org source tracking, source control, and continuous integration and deployment. 12 | 13 | If you are starting a new project, we recommend that you consider the package development model. To start developing with this model in Visual Studio Code, see [Package Development Model with VS Code](https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/package-development-model). For details about the model, see the [Package Development Model](https://trailhead.salesforce.com/en/content/learn/modules/sfdx_dev_model) Trailhead module. 14 | 15 | If you are developing against scratch orgs, use the command `SFDX: Create Project` (VS Code) or `sfdx force:project:create` (Salesforce CLI) to create your project. If you used another command, you might want to start over with that command. 16 | 17 | When working with source-tracked orgs, use the commands `SFDX: Push Source to Org` (VS Code) or `sfdx force:source:push` (Salesforce CLI) and `SFDX: Pull Source from Org` (VS Code) or `sfdx force:source:pull` (Salesforce CLI). Do not use the `Retrieve` and `Deploy` commands with scratch orgs. 18 | 19 | ### Org Development Model 20 | 21 | The org development model allows you to connect directly to a non-source-tracked org (sandbox, Developer Edition (DE) org, Trailhead Playground, or even a production org) to retrieve and deploy code directly. This model is similar to the type of development you have done in the past using tools such as Force.com IDE or MavensMate. 22 | 23 | To start developing with this model in Visual Studio Code, see [Org Development Model with VS Code](https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/org-development-model). For details about the model, see the [Org Development Model](https://trailhead.salesforce.com/content/learn/modules/org-development-model) Trailhead module. 24 | 25 | If you are developing against non-source-tracked orgs, use the command `SFDX: Create Project with Manifest` (VS Code) or `sfdx force:project:create --manifest` (Salesforce CLI) to create your project. If you used another command, you might want to start over with this command to create a Salesforce DX project. 26 | 27 | When working with non-source-tracked orgs, use the commands `SFDX: Deploy Source to Org` (VS Code) or `sfdx force:source:deploy` (Salesforce CLI) and `SFDX: Retrieve Source from Org` (VS Code) or `sfdx force:source:retrieve` (Salesforce CLI). The `Push` and `Pull` commands work only on orgs with source tracking (scratch orgs). 28 | 29 | ## The `sfdx-project.json` File 30 | 31 | The `sfdx-project.json` file contains useful configuration information for your project. See [Salesforce DX Project Configuration](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_config.htm) in the _Salesforce DX Developer Guide_ for details about this file. 32 | 33 | The most important parts of this file for getting started are the `sfdcLoginUrl` and `packageDirectories` properties. 34 | 35 | The `sfdcLoginUrl` specifies the default login URL to use when authorizing an org. 36 | 37 | The `packageDirectories` filepath tells VS Code and Salesforce CLI where the metadata files for your project are stored. You need at least one package directory set in your file. The default setting is shown below. If you set the value of the `packageDirectories` property called `path` to `force-app`, by default your metadata goes in the `force-app` directory. If you want to change that directory to something like `src`, simply change the `path` value and make sure the directory you’re pointing to exists. 38 | 39 | ```json 40 | "packageDirectories" : [ 41 | { 42 | "path": "force-app", 43 | "default": true 44 | } 45 | ] 46 | ``` 47 | 48 | ## Part 2: Working with Source 49 | 50 | For details about developing against scratch orgs, see the [Package Development Model](https://trailhead.salesforce.com/en/content/learn/modules/sfdx_dev_model) module on Trailhead or [Package Development Model with VS Code](https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/package-development-model). 51 | 52 | For details about developing against orgs that don’t have source tracking, see the [Org Development Model](https://trailhead.salesforce.com/content/learn/modules/org-development-model) module on Trailhead or [Org Development Model with VS Code](https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/org-development-model). 53 | 54 | ## Part 3: Deploying to Production 55 | 56 | Don’t deploy your code to production directly from Visual Studio Code. The deploy and retrieve commands do not support transactional operations, which means that a deployment can fail in a partial state. Also, the deploy and retrieve commands don’t run the tests needed for production deployments. The push and pull commands are disabled for orgs that don’t have source tracking, including production orgs. 57 | 58 | Deploy your changes to production using [packaging](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_dev2gp.htm) or by [converting your source](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_source.htm#cli_reference_convert) into metadata format and using the [metadata deploy command](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_force_mdapi.htm#cli_reference_deploy). 59 | --------------------------------------------------------------------------------