From 3c6ef92cdb17ba7f5639f2522916c01ec6c77eb6 Mon Sep 17 00:00:00 2001 From: Mohit Sharma Date: Tue, 28 Jan 2020 00:58:05 +0530 Subject: [PATCH 1/2] Update Hello.cls add more errors --- Hello.cls | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Hello.cls b/Hello.cls index dfda7d3..4d210d1 100644 --- a/Hello.cls +++ b/Hello.cls @@ -2,8 +2,11 @@ public class hello { public hello() { for(Integer i = 0; i < 5; i++) { - Account a = [SELECT Id,Name FROM Account WHERE Name='Barclays'][0]; + Account a = [SELECT Id,Name,Phone FROM Account WHERE Name='Barclays'][0]; + a.Phone = 'NA'; + insert a; } + } } From b241edb5762ca75576aaaf99fe24d02933d21c18 Mon Sep 17 00:00:00 2001 From: Mohit Sharma Date: Tue, 28 Jan 2020 01:01:38 +0530 Subject: [PATCH 2/2] Update Hello.cls - add try catch add try catch --- Hello.cls | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Hello.cls b/Hello.cls index 4d210d1..4f18069 100644 --- a/Hello.cls +++ b/Hello.cls @@ -4,7 +4,11 @@ public class hello { for(Integer i = 0; i < 5; i++) { Account a = [SELECT Id,Name,Phone FROM Account WHERE Name='Barclays'][0]; a.Phone = 'NA'; + try { insert a; + } catch (DmlException e) { + System.debug(e); + } } }