So, I been trying to push the source code to the default scratch org which i have created using VS Code but I keep getting this error.
Starting SFDX: Push Source to Default Scratch Org
00:14:34.116 sfdx force:source:push --json --loglevel fatal 00:14:56.553 sfdx force:source:push --json --loglevel fatal ended with exit code 1
=== Push Errors PROJECT PATH >ERRORS
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ─────────────────────────────────────────────────────────────────────────────────────────
e:\Salesforce\Project-Management-Application-Salesforce\force-app\main\default\applications\Project_Management_Application.app-meta.xml >In field: utilityBar - no FlexiPage named Project_Management_Application_UtilityBar found e:\Salesforce\Project-Management-Application-Salesforce\force-app\main\default\triggers\assoContact.trigger >Variable does not exist: Number_of_Opportunities__c (17:18) ```
This is for the first error:
e:\Salesforce\Project-Management-Application-Salesforce\force-app\main\default\applications\Project_Management_Application.app-meta.xml In field: utilityBar - no FlexiPage named Project_Management_Application_UtilityBar found
<CustomApplication xmlns="http://soap.sforce.com/2006/04/metadata">
<brand>
<headerColor>#0070D2</headerColor>
<logo>PMA</logo>
<logoVersion>1</logoVersion>
<shouldOverrideOrgTheme>false</shouldOverrideOrgTheme>
</brand>
<description>Project Management Application is a great project management software for the project management power user. Teamwork Projects includes all the tools you’ll need to track the development of a project</description>
<formFactors>Small</formFactors>
<formFactors>Large</formFactors>
<isNavAutoTempTabsDisabled>false</isNavAutoTempTabsDisabled>
<isNavPersonalizationDisabled>false</isNavPersonalizationDisabled>
<label>Project Management Application</label>
<navType>Standard</navType>
<tabs>standard-home</tabs>
<tabs>Project__c</tabs>
<tabs>Client__c</tabs>
<tabs>Releases__c</tabs>
<tabs>Employee__c</tabs>
<tabs>Requirement__c</tabs>
<tabs>Task_Assigned__c</tabs>
<uiType>Lightning</uiType>
<utilityBar>Project_Management_Application_UtilityBar</utilityBar>
</CustomApplication>
And for the second one
e:\Salesforce\Project-Management-Application-Salesforce\force-app\main\default\triggers\assoContact.trigger Variable does not exist: Number_of_Opportunities__c (17:18)
{
if(Trigger.isAfter && Trigger.isInsert)
{
List<Contact> ListCon = new List<Contact>();
List<Opportunity> ListOpp = new List<Opportunity>();
for(Account A : Trigger.new)
{
Contact C = new Contact();
C.AccountId = A.Id;
C.LastName = A.Name;
C.Phone = A.Phone;
ListCon.add(C);
System.debug(C.LastName+'Added to list');
if(A.Number_of_Opportunities__c > 0)
{
for(Integer i=0; i < A.Number_of_Opportunities__c ; i++ )
{
Opportunity opp = new Opportunity();
opp.AccountId = A.Id;
opp.Name = A.Name+' '+i ;
Date d1 = Date.today();
opp.CloseDate = d1.addDays(30);
opp.StageName='Prospecting';
ListOpp.add(opp);
}
}
if(ListOpp != NULL)
insert ListOpp;
System.debug('Opportuity List added susccesfuly');
if(ListCon != NULL)
insert ListCon;
System.debug('Contact List added susccesfuly');
}
}
}
This are the logs for it:
21:08:36.398 sfdx force:source:push --json --loglevel fatal
21:09:08.890 sfdx force:source:push --json --loglevel fatal
ended with exit code 1
=== Push Errors
PROJECT PATH ERRORS
Can anyone please help me with it ?