Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Trigger BuildComponentBI on Build_Component__c(before insert , before update) {
- if (Trigger.isBefore && (Trigger.isInsert || Trigger.isUpdate)) {
- double q = 0;
- for (Build_Component__c C: Trigger.new) {
- if (C.Manual_Override__c == False){
- List<Effort_Matrix__c> em = Effort_Matrix__c.getall().values();
- q = c.Scale__c;
- For(Effort_Matrix__c e:em){
- if(e.Component_Name__c == c.Type__c){
- if(e.Phase__c == 'Build'){
- c.Estimated_Build_Hours__c = e.OOM__c * q;
- }
- if(e.phase__c == 'Analysis'){
- c.Estimated_Analysis_Hours__c = e.OOM__c * q;
- }
- if(e.phase__c == 'SIT'){
- c.Estimated_SIT_Hours__c = e.OOM__c * q;
- }
- if(e.phase__c == 'Deployment'){
- c.Estimated_Deployment_Hours__c = e.OOM__c * q;
- }
- if(e.phase__c == 'UAT'){
- c.Estimated_UAT_Hours__c = e.OOM__c * q;
- }
- if(e.phase__c == 'Unit Test'){
- c.Estimated_Unit_Test_Hours__c = e.OOM__c * q;
- }
- if(e.phase__c == 'Design'){
- c.Estimated_Design_Hours__c = e.OOM__c * q;
- }
- else{}
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement