Advertisement
Guest User

Untitled

a guest
Sep 15th, 2014
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. Trigger BuildComponentBI on Build_Component__c(before insert , before update) {
  2. if (Trigger.isBefore && (Trigger.isInsert || Trigger.isUpdate)) {
  3. double q = 0;
  4. for (Build_Component__c C: Trigger.new) {
  5. if (C.Manual_Override__c == False){
  6.  
  7. List<Effort_Matrix__c> em = Effort_Matrix__c.getall().values();
  8.  
  9. q = c.Scale__c;
  10.  
  11. For(Effort_Matrix__c e:em){
  12. if(e.Component_Name__c == c.Type__c){
  13. if(e.Phase__c == 'Build'){
  14. c.Estimated_Build_Hours__c = e.OOM__c * q;
  15. }
  16. if(e.phase__c == 'Analysis'){
  17. c.Estimated_Analysis_Hours__c = e.OOM__c * q;
  18. }
  19. if(e.phase__c == 'SIT'){
  20. c.Estimated_SIT_Hours__c = e.OOM__c * q;
  21. }
  22. if(e.phase__c == 'Deployment'){
  23. c.Estimated_Deployment_Hours__c = e.OOM__c * q;
  24. }
  25. if(e.phase__c == 'UAT'){
  26. c.Estimated_UAT_Hours__c = e.OOM__c * q;
  27. }
  28. if(e.phase__c == 'Unit Test'){
  29. c.Estimated_Unit_Test_Hours__c = e.OOM__c * q;
  30. }
  31. if(e.phase__c == 'Design'){
  32. c.Estimated_Design_Hours__c = e.OOM__c * q;
  33. }
  34. else{}
  35. }
  36. }
  37. }
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement