Guest User

Untitled

a guest
May 16th, 2018
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.07 KB | None | 0 0
  1.  
  2. trigger PhysicianVisit_AU_UpdateFutureVisits on Physician_Visit__c (after Update)
  3. {
  4.  
  5. if(clsPhysicianVisitUpdate.isExecute == false && clsPhysicianVisitUpdate.isInsert == false)
  6. {
  7. clsPhysicianVisitUpdate.isExecute = true;
  8.  
  9. if(!clsPhysicianVisitUpdate.blnIsTriggerFiredAlreadyForJntFldWrk)
  10. {
  11.  
  12. if(Trigger.isUpdate)
  13. {
  14. try
  15. {
  16. clsUpdateFuturePhysicianVisits oclsUpdateFuturePhysicianVisits = new clsUpdateFuturePhysicianVisits();
  17. oclsUpdateFuturePhysicianVisits.updateFuturePhysicianVisits(trigger.new,'update');
  18.  
  19. //List of affected physician visits.
  20. List<Physician_Visit__c> list_PhysicianVisit = [select Id, OwnerId, Activity_Date__c, recordType.Name, Status__c, Call_Objective__c, Call_Objective_Achieved__c from Physician_Visit__c where id in :Trigger.New];
  21. //Proceed only if the status of any of the record is completed.
  22. Boolean blnContinue = False;
  23.  
  24. for (Physician_Visit__c pv:list_PhysicianVisit){
  25. System.debug('TESTTTTTINNNNNGGGGG>>>>'+pv.Status__c);
  26. if (pv.Status__c=='Completed'){
  27. blnContinue = True;
  28. break;
  29. }
  30. }
  31. if (!blnContinue) return;
  32.  
  33. //List of Call summaries to insert.update.
  34. List<Call_Summary__c> list_CallSummary = new List<Call_Summary__c>();
  35.  
  36. //List of effectiveness summaries to insert.update.
  37. List<Effectiveness_Summary__c> list_EffectivenessSummary = new List<Effectiveness_Summary__c>();
  38.  
  39. //Get the user values.
  40. User objUser = [Select Id, Name, APAC_Country__c, APAC_Region__c, APAC_Area__c, Profile.Name From User Where Id=:Userinfo.getUserId()];
  41.  
  42. //Get the user profile.
  43. //Profile objProfile = [Select Name from Profile where id=:Userinfo.getProfileId()];
  44. String strProfile = objUser.Profile.Name;
  45. if (strProfile.contains('Service')){
  46. strProfile = 'Service';
  47. }else{
  48. strProfile = 'Sales';
  49. }
  50.  
  51. //For-loop: loops through each affected store visit record.
  52. for(Physician_Visit__c p : list_PhysicianVisit){
  53.  
  54.  
  55. /*
  56. * To update the call summary and effectiveness summary objects.
  57. *
  58. */
  59. if (p.Status__c=='Completed'){
  60. //Map of the unique value and the no. of actual calls for the day.
  61. Map<String, Integer> map_Unique_ActualCalls = new Map<String, Integer>();
  62. //Map of the unique value and the no. of planned calls for the day.
  63. Map<String, Integer> map_Unique_PlannedCalls = new Map<String, Integer>();
  64. //Map of the unique value and the no. of targetted calls for the day.
  65. Map<String, Integer> map_Unique_TragettedCalls = new Map<String, Integer>();
  66.  
  67. //Map of the unique value and the no. of actual calls for the day.
  68. Map<String, Integer> map_UniqueEffectiveness_ActualCalls = new Map<String, Integer>();
  69. //Map of the unique value and objective for the day.
  70. Map<String, Integer> map_UniqueEffectiveness_Obj = new Map<String, Integer>();
  71.  
  72. //List of Physician visits by the rep for the visit date.
  73. List<Physician_Visit__c> list_PhysicianVisitsForDay = [Select Segmentation__c, Planned_Call__c, Status__c, Call_Objective__c, Call_Objective_Achieved__c from Physician_Visit__c where Activity_Date__c = :p.Activity_Date__c and OwnerId = :p.OwnerId];
  74.  
  75. //for-loop: to calculate the no. of actual, planned and targetted calls.
  76. for (Physician_Visit__c pv : list_PhysicianVisitsForDay){
  77. //Unique value to represent a call summary record.
  78. String strUnique = String.valueOf(p.OwnerId)+String.valueOf(p.Activity_Date__c);
  79.  
  80. //Unique value to represent a effectiveness summary record.
  81. String strUniqueEffectiveness = String.valueOf(pv.Segmentation__c)+String.valueOf(p.OwnerId)+String.valueOf(p.Activity_Date__c);
  82.  
  83. //If the status is completed.
  84. if (pv.Status__c=='Completed'){
  85. Integer intActualCalls = 1;
  86. if (map_Unique_ActualCalls.containsKey(strUnique)){
  87. intActualCalls = map_Unique_ActualCalls.get(strUnique) + 1;
  88. }
  89. System.debug('unique='+strUnique+',intActualCalls'+intActualCalls);
  90. map_Unique_ActualCalls.put(strUnique, intActualCalls);
  91. //If the visit is a planned one.
  92. if (pv.Planned_Call__c == True){
  93. Integer intTargettedCalls = 1;
  94. if (map_Unique_TragettedCalls.containsKey(strUnique)){
  95. intTargettedCalls = map_Unique_TragettedCalls.get(strUnique) + 1;
  96. }
  97. System.debug('unique='+strUnique+',intTargettedCalls'+intTargettedCalls);
  98. map_Unique_TragettedCalls.put(strUnique, intTargettedCalls);
  99. }
  100.  
  101. if (map_UniqueEffectiveness_ActualCalls.containsKey(strUniqueEffectiveness)){
  102. intActualCalls = map_UniqueEffectiveness_ActualCalls.get(strUniqueEffectiveness) + 1;
  103. }
  104. System.debug('unique='+strUniqueEffectiveness+',intActualCalls'+intActualCalls);
  105. map_UniqueEffectiveness_ActualCalls.put(strUniqueEffectiveness, intActualCalls);
  106.  
  107. //If objective is achieved.
  108. if (pv.Call_Objective_Achieved__c==TRUE){
  109. Integer intObj = 1;
  110. if (map_UniqueEffectiveness_Obj.containsKey(strUniqueEffectiveness)){
  111. intObj = map_UniqueEffectiveness_Obj.get(strUniqueEffectiveness) + 1;
  112. }
  113. System.debug('unique='+strUniqueEffectiveness+',intObj'+intObj);
  114. map_UniqueEffectiveness_Obj.put(strUniqueEffectiveness, intObj);
  115. }
  116. }
  117. //If the visit is a planned one.
  118. if (pv.Planned_Call__c == True) {
  119. Integer intPlannedCalls = 1;
  120. if (map_Unique_PlannedCalls.containsKey(strUnique)){
  121. intPlannedCalls = map_Unique_PlannedCalls.get(strUnique) + 1;
  122. }
  123. System.debug('unique='+strUnique+',intPlannedCalls'+intPlannedCalls);
  124. map_Unique_PlannedCalls.put(strUnique, intPlannedCalls);
  125. }
  126. }
  127.  
  128. //Business_Day_or_not__c is '0' on Weekends and '1' on Weekdays
  129. Datetime dtmVisitDate = Datetime.newInstance(p.Activity_Date__c, Time.newInstance(0,0,0,0));
  130. String strWeekday = dtmVisitDate.format('E');
  131. Boolean blnBusinessDay = TRUE;
  132. if(strWeekday == 'Sat' || strWeekday == 'Sun'){
  133. blnBusinessDay = FALSE;
  134. }
  135.  
  136. //Set of the unique values for call summary.
  137. Set<String> list_Unique = new Set<String>();
  138.  
  139. //Set of the unique values for effectiveness summary.
  140. Set<String> list_UniqueEffectiveness = new Set<String>();
  141.  
  142. //for-loop: to create the call summary & effectiveness summary records.
  143. for (Physician_Visit__c pv : list_PhysicianVisitsForDay){
  144. //Unique value to represent a call summary record.
  145. String strUnique = String.valueOf(p.OwnerId)+String.valueOf(p.Activity_Date__c);
  146.  
  147. //Unique value to represent a effectiveness summary record.
  148. String strUniqueEffectiveness = String.valueOf(pv.Segmentation__c)+String.valueOf(p.OwnerId)+String.valueOf(p.Activity_Date__c);
  149.  
  150. //To create the call summary record.
  151. if (!list_Unique.contains(strUnique)) {
  152. Call_Summary__c objCallSummary = new Call_Summary__c();
  153. objCallSummary.Country__c = objUser.APAC_Country__c;
  154. objCallSummary.RegionINDSU__c = objUser.APAC_Region__c;
  155. objCallSummary.Area__c = objUser.APAC_Area__c;
  156. objCallSummary.Date__c = p.Activity_Date__c;
  157. objCallSummary.Business_Day_or_not__c = blnBusinessDay;
  158. objCallSummary.Actual_Calls__c = (map_Unique_ActualCalls.containsKey(strUnique) ? map_Unique_ActualCalls.get(strUnique) : 0);
  159. objCallSummary.Planned_Calls__c = (map_Unique_PlannedCalls.containsKey(strUnique) ? map_Unique_PlannedCalls.get(strUnique) : 0);
  160. objCallSummary.Targeted_Calls__c = (map_Unique_TragettedCalls.containsKey(strUnique) ? map_Unique_TragettedCalls.get(strUnique) : 0);
  161. objCallSummary.Profile__c = strProfile;
  162. objCallSummary.OwnerId = p.OwnerId;
  163. objCallSummary.Unique__c = strUnique;
  164. list_CallSummary.add(objCallSummary);
  165. list_Unique.add(strUnique);
  166. System.debug('unique value='+strUnique+',actual='+objCallSummary.Actual_Calls__c+',planned='+objCallSummary.Planned_Calls__c+'targetted='+objCallSummary.Targeted_Calls__c);
  167. }
  168.  
  169. //To create the effectiveness summary record.
  170. if (!list_UniqueEffectiveness.contains(strUniqueEffectiveness)) {
  171. Effectiveness_Summary__c objEffectSummary = new Effectiveness_Summary__c();
  172. objEffectSummary.ABC_Classification__c = pv.Segmentation__c;
  173. objEffectSummary.Country__c = objUser.APAC_Country__c;
  174. objEffectSummary.Region__c = objUser.APAC_Region__c;
  175. objEffectSummary.Area__c = objUser.APAC_Area__c;
  176. objEffectSummary.Date__c = p.Activity_Date__c;
  177. objEffectSummary.Actual_Calls__c = (map_UniqueEffectiveness_ActualCalls.containsKey(strUniqueEffectiveness) ? map_UniqueEffectiveness_ActualCalls.get(strUniqueEffectiveness) : 0);
  178. objEffectSummary.Objective_Met__c = (map_UniqueEffectiveness_Obj.containsKey(strUniqueEffectiveness) ? map_UniqueEffectiveness_Obj.get(strUniqueEffectiveness) : 0);
  179. objEffectSummary.Profile__c = strProfile;
  180. objEffectSummary.OwnerId = p.OwnerId;
  181. objEffectSummary.Unique__c = strUniqueEffectiveness;
  182. list_EffectivenessSummary.add(objEffectSummary);
  183. list_UniqueEffectiveness.add(strUniqueEffectiveness);
  184. //System.debug('unique value='+strUniqueEffectiveness+',actual='+objEffectSummary.Actual_Calls__c+',No_of_objective_1s_met__c='+objEffectSummary.No_of_objective_1s_met__c+'No_of_objective_2s_met__c='+objEffectSummary.No_of_objective_2s_met__c+'No_of_objective_3s_met__c='+objEffectSummary.No_of_objective_3s_met__c);
  185. }
  186. }
  187. }
  188. }
  189. //To update the call summary.
  190. if (list_CallSummary.Size()>0){
  191. Database.upsert(list_CallSummary,Call_Summary__c.Unique__c,false);
  192. }
  193.  
  194. //To update the effectiveness summary.
  195. if (list_EffectivenessSummary.Size()>0){
  196. Database.upsert(list_EffectivenessSummary,Effectiveness_Summary__c.Unique__c,false);
  197. }
  198.  
  199. }
  200. catch(Exception e)
  201. {
  202. Trigger.New[0].addError('Error occurred in Updating future Physician Visits - ' + e);
  203. }
  204. }
  205. }
  206. }
  207. }
  208. trigger PhysicianVisit_AU_UpdateFutureVisits on Physician_Visit__c (after Update)
  209. {
  210. /*
  211. *
  212. * This trigger future Physician Visit Records whenever an update happens on Physician Visit
  213. *
  214. * Author |Author-Email |Date |Comment
  215. * ------------------------------|------------------------------------------------- |------------|----------------------------------------------------
  216. * DeepaLakshmi.R |deepalakshmi.venkatesh@listertechnologies.com |30.04.2010 |First Draft
  217. *
  218. * DeepaLakshmi.R |deepalakshmi.venkatesh@listertechnologies.com |30.04.2010 |Second Draft to update call summary, effectiveness summary
  219. *
  220. */
  221.  
  222. if(clsPhysicianVisitUpdate.isExecute == false && clsPhysicianVisitUpdate.isInsert == false)
  223. {
  224. clsPhysicianVisitUpdate.isExecute = true;
  225.  
  226. if(!clsPhysicianVisitUpdate.blnIsTriggerFiredAlreadyForJntFldWrk)
  227. {
  228.  
  229. if(Trigger.isUpdate)
  230. {
  231. try
  232. {
  233. clsUpdateFuturePhysicianVisits oclsUpdateFuturePhysicianVisits = new clsUpdateFuturePhysicianVisits();
  234. oclsUpdateFuturePhysicianVisits.updateFuturePhysicianVisits(trigger.new,'update');
  235.  
  236. //List of affected physician visits.
  237. List<Physician_Visit__c> list_PhysicianVisit = [select Id, OwnerId, Activity_Date__c, recordType.Name, Status__c, Call_Objective__c, Call_Objective_Achieved__c from Physician_Visit__c where id in :Trigger.New];
  238. //Proceed only if the status of any of the record is completed.
  239. Boolean blnContinue = False;
  240.  
  241. for (Physician_Visit__c pv:list_PhysicianVisit){
  242. System.debug('TESTTTTTINNNNNGGGGG>>>>'+pv.Status__c);
  243. if (pv.Status__c=='Completed'){
  244. blnContinue = True;
  245. break;
  246. }
  247. }
  248. if (!blnContinue) return;
  249.  
  250. //List of Call summaries to insert.update.
  251. List<Call_Summary__c> list_CallSummary = new List<Call_Summary__c>();
  252.  
  253. //List of effectiveness summaries to insert.update.
  254. List<Effectiveness_Summary__c> list_EffectivenessSummary = new List<Effectiveness_Summary__c>();
  255.  
  256. //Get the user values.
  257. User objUser = [Select Id, Name, APAC_Country__c, APAC_Region__c, APAC_Area__c, Profile.Name From User Where Id=:Userinfo.getUserId()];
  258.  
  259. //Get the user profile.
  260. //Profile objProfile = [Select Name from Profile where id=:Userinfo.getProfileId()];
  261. String strProfile = objUser.Profile.Name;
  262. if (strProfile.contains('Service')){
  263. strProfile = 'Service';
  264. }else{
  265. strProfile = 'Sales';
  266. }
  267.  
  268. //For-loop: loops through each affected store visit record.
  269. for(Physician_Visit__c p : list_PhysicianVisit){
  270.  
  271.  
  272. /*
  273. * To update the call summary and effectiveness summary objects.
  274. *
  275. */
  276. if (p.Status__c=='Completed'){
  277. //Map of the unique value and the no. of actual calls for the day.
  278. Map<String, Integer> map_Unique_ActualCalls = new Map<String, Integer>();
  279. //Map of the unique value and the no. of planned calls for the day.
  280. Map<String, Integer> map_Unique_PlannedCalls = new Map<String, Integer>();
  281. //Map of the unique value and the no. of targetted calls for the day.
  282. Map<String, Integer> map_Unique_TragettedCalls = new Map<String, Integer>();
  283.  
  284. //Map of the unique value and the no. of actual calls for the day.
  285. Map<String, Integer> map_UniqueEffectiveness_ActualCalls = new Map<String, Integer>();
  286. //Map of the unique value and objective for the day.
  287. Map<String, Integer> map_UniqueEffectiveness_Obj = new Map<String, Integer>();
  288.  
  289. //List of Physician visits by the rep for the visit date.
  290. List<Physician_Visit__c> list_PhysicianVisitsForDay = [Select Segmentation__c, Planned_Call__c, Status__c, Call_Objective__c, Call_Objective_Achieved__c from Physician_Visit__c where Activity_Date__c = :p.Activity_Date__c and OwnerId = :p.OwnerId];
  291.  
  292. //for-loop: to calculate the no. of actual, planned and targetted calls.
  293. for (Physician_Visit__c pv : list_PhysicianVisitsForDay){
  294. //Unique value to represent a call summary record.
  295. String strUnique = String.valueOf(p.OwnerId)+String.valueOf(p.Activity_Date__c);
  296.  
  297. //Unique value to represent a effectiveness summary record.
  298. String strUniqueEffectiveness = String.valueOf(pv.Segmentation__c)+String.valueOf(p.OwnerId)+String.valueOf(p.Activity_Date__c);
  299.  
  300. //If the status is completed.
  301. if (pv.Status__c=='Completed'){
  302. Integer intActualCalls = 1;
  303. if (map_Unique_ActualCalls.containsKey(strUnique)){
  304. intActualCalls = map_Unique_ActualCalls.get(strUnique) + 1;
  305. }
  306. System.debug('unique='+strUnique+',intActualCalls'+intActualCalls);
  307. map_Unique_ActualCalls.put(strUnique, intActualCalls);
  308. //If the visit is a planned one.
  309. if (pv.Planned_Call__c == True){
  310. Integer intTargettedCalls = 1;
  311. if (map_Unique_TragettedCalls.containsKey(strUnique)){
  312. intTargettedCalls = map_Unique_TragettedCalls.get(strUnique) + 1;
  313. }
  314. System.debug('unique='+strUnique+',intTargettedCalls'+intTargettedCalls);
  315. map_Unique_TragettedCalls.put(strUnique, intTargettedCalls);
  316. }
  317.  
  318. if (map_UniqueEffectiveness_ActualCalls.containsKey(strUniqueEffectiveness)){
  319. intActualCalls = map_UniqueEffectiveness_ActualCalls.get(strUniqueEffectiveness) + 1;
  320. }
  321. System.debug('unique='+strUniqueEffectiveness+',intActualCalls'+intActualCalls);
  322. map_UniqueEffectiveness_ActualCalls.put(strUniqueEffectiveness, intActualCalls);
  323.  
  324. //If objective is achieved.
  325. if (pv.Call_Objective_Achieved__c==TRUE){
  326. Integer intObj = 1;
  327. if (map_UniqueEffectiveness_Obj.containsKey(strUniqueEffectiveness)){
  328. intObj = map_UniqueEffectiveness_Obj.get(strUniqueEffectiveness) + 1;
  329. }
  330. System.debug('unique='+strUniqueEffectiveness+',intObj'+intObj);
  331. map_UniqueEffectiveness_Obj.put(strUniqueEffectiveness, intObj);
  332. }
  333. }
  334. //If the visit is a planned one.
  335. if (pv.Planned_Call__c == True) {
  336. Integer intPlannedCalls = 1;
  337. if (map_Unique_PlannedCalls.containsKey(strUnique)){
  338. intPlannedCalls = map_Unique_PlannedCalls.get(strUnique) + 1;
  339. }
  340. System.debug('unique='+strUnique+',intPlannedCalls'+intPlannedCalls);
  341. map_Unique_PlannedCalls.put(strUnique, intPlannedCalls);
  342. }
  343. }
  344.  
  345. //Business_Day_or_not__c is '0' on Weekends and '1' on Weekdays
  346. Datetime dtmVisitDate = Datetime.newInstance(p.Activity_Date__c, Time.newInstance(0,0,0,0));
  347. String strWeekday = dtmVisitDate.format('E');
  348. Boolean blnBusinessDay = TRUE;
  349. if(strWeekday == 'Sat' || strWeekday == 'Sun'){
  350. blnBusinessDay = FALSE;
  351. }
  352.  
  353. //Set of the unique values for call summary.
  354. Set<String> list_Unique = new Set<String>();
  355.  
  356. //Set of the unique values for effectiveness summary.
  357. Set<String> list_UniqueEffectiveness = new Set<String>();
  358.  
  359. //for-loop: to create the call summary & effectiveness summary records.
  360. for (Physician_Visit__c pv : list_PhysicianVisitsForDay){
  361. //Unique value to represent a call summary record.
  362. String strUnique = String.valueOf(p.OwnerId)+String.valueOf(p.Activity_Date__c);
  363.  
  364. //Unique value to represent a effectiveness summary record.
  365. String strUniqueEffectiveness = String.valueOf(pv.Segmentation__c)+String.valueOf(p.OwnerId)+String.valueOf(p.Activity_Date__c);
  366.  
  367. //To create the call summary record.
  368. if (!list_Unique.contains(strUnique)) {
  369. Call_Summary__c objCallSummary = new Call_Summary__c();
  370. objCallSummary.Country__c = objUser.APAC_Country__c;
  371. objCallSummary.RegionINDSU__c = objUser.APAC_Region__c;
  372. objCallSummary.Area__c = objUser.APAC_Area__c;
  373. objCallSummary.Date__c = p.Activity_Date__c;
  374. objCallSummary.Business_Day_or_not__c = blnBusinessDay;
  375. objCallSummary.Actual_Calls__c = (map_Unique_ActualCalls.containsKey(strUnique) ? map_Unique_ActualCalls.get(strUnique) : 0);
  376. objCallSummary.Planned_Calls__c = (map_Unique_PlannedCalls.containsKey(strUnique) ? map_Unique_PlannedCalls.get(strUnique) : 0);
  377. objCallSummary.Targeted_Calls__c = (map_Unique_TragettedCalls.containsKey(strUnique) ? map_Unique_TragettedCalls.get(strUnique) : 0);
  378. objCallSummary.Profile__c = strProfile;
  379. objCallSummary.OwnerId = p.OwnerId;
  380. objCallSummary.Unique__c = strUnique;
  381. list_CallSummary.add(objCallSummary);
  382. list_Unique.add(strUnique);
  383. System.debug('unique value='+strUnique+',actual='+objCallSummary.Actual_Calls__c+',planned='+objCallSummary.Planned_Calls__c+'targetted='+objCallSummary.Targeted_Calls__c);
  384. }
  385.  
  386. //To create the effectiveness summary record.
  387. if (!list_UniqueEffectiveness.contains(strUniqueEffectiveness)) {
  388. Effectiveness_Summary__c objEffectSummary = new Effectiveness_Summary__c();
  389. objEffectSummary.ABC_Classification__c = pv.Segmentation__c;
  390. objEffectSummary.Country__c = objUser.APAC_Country__c;
  391. objEffectSummary.Region__c = objUser.APAC_Region__c;
  392. objEffectSummary.Area__c = objUser.APAC_Area__c;
  393. objEffectSummary.Date__c = p.Activity_Date__c;
  394. objEffectSummary.Actual_Calls__c = (map_UniqueEffectiveness_ActualCalls.containsKey(strUniqueEffectiveness) ? map_UniqueEffectiveness_ActualCalls.get(strUniqueEffectiveness) : 0);
  395. objEffectSummary.Objective_Met__c = (map_UniqueEffectiveness_Obj.containsKey(strUniqueEffectiveness) ? map_UniqueEffectiveness_Obj.get(strUniqueEffectiveness) : 0);
  396. objEffectSummary.Profile__c = strProfile;
  397. objEffectSummary.OwnerId = p.OwnerId;
  398. objEffectSummary.Unique__c = strUniqueEffectiveness;
  399. list_EffectivenessSummary.add(objEffectSummary);
  400. list_UniqueEffectiveness.add(strUniqueEffectiveness);
  401. //System.debug('unique value='+strUniqueEffectiveness+',actual='+objEffectSummary.Actual_Calls__c+',No_of_objective_1s_met__c='+objEffectSummary.No_of_objective_1s_met__c+'No_of_objective_2s_met__c='+objEffectSummary.No_of_objective_2s_met__c+'No_of_objective_3s_met__c='+objEffectSummary.No_of_objective_3s_met__c);
  402. }
  403. }
  404. }
  405. }
  406. //To update the call summary.
  407. if (list_CallSummary.Size()>0){
  408. Database.upsert(list_CallSummary,Call_Summary__c.Unique__c,false);
  409. }
  410.  
  411. //To update the effectiveness summary.
  412. if (list_EffectivenessSummary.Size()>0){
  413. Database.upsert(list_EffectivenessSummary,Effectiveness_Summary__c.Unique__c,false);
  414. }
  415.  
  416. }
  417. catch(Exception e)
  418. {
  419. Trigger.New[0].addError('Error occurred in Updating future Physician Visits - ' + e);
  420. }
  421. }
  422. }
  423. }
  424. }
Add Comment
Please, Sign In to add comment