diff --git a/ContactTrigger.trigger b/ContactTrigger.trigger new file mode 100644 index 0000000..12f118f --- /dev/null +++ b/ContactTrigger.trigger @@ -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 opps = new List(); + + 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); + } + } + } + } + +} \ No newline at end of file diff --git a/SquareCallout.cls b/SquareCallout.cls new file mode 100644 index 0000000..e69de29 diff --git a/cumulusci.yml b/cumulusci.yml index caa92f3..86cdd89 100644 --- a/cumulusci.yml +++ b/cumulusci.yml @@ -1,4 +1,4 @@ -minimum_cumulusci_version: '3.82.0' +minimum_cumulusci_version: '3.80.0' project: name: rugbyDay package: