Skip to content

Commit

Permalink
Merge pull request #6 from beAGoodQE/feature/fixes
Browse files Browse the repository at this point in the history
fixes
  • Loading branch information
beAGoodQE authored Apr 20, 2024
2 parents 6b331c1 + addba0d commit 0f91b99
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions ContactTrigger.trigger
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
trigger ContactTrigger on Contact (after insert) {

if(Trigger.isInsert) {

if(Trigger.isBefore) {
// Placeholder for future 'before insert' work
}

if(Trigger.isAfter) {
List<Opportunity> opps = new List<Opportunity>();

for (Contact con : Trigger.New) {

Opportunity opp = new Opportunity();
opp.ContactId = con.Id;
opp.Name = 'Test Run';
opp.StageName = 'Prospecting';
opp.CloseDate = Date.today().addDays(30);
opps.add(opp);
}

if (!opps.isEmpty()) {
try{
insert opps;
} catch (DMLException e) {
// TODO: Add some better handling
System.debug(e);
}
}
}
}

}
Empty file added SquareCallout.cls
Empty file.
2 changes: 1 addition & 1 deletion cumulusci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
minimum_cumulusci_version: '3.82.0'
minimum_cumulusci_version: '3.80.0'
project:
name: rugbyDay
package:
Expand Down

0 comments on commit 0f91b99

Please sign in to comment.