Skip to main content
anvesh p fragte in #Apex
I have created a trigger.. contact is lookup. and i am assigning contact obj user value to current object.debug logs showing the value existed. but it is not assigned in record field.?

trigger NIGO_update on NIGOs__c(before insert,before update){

List<NIGOs__c> NgList = [select id,name,Contact_Name__c,Product_Type__c,Contact_Name__r.Annuity_Territory_Wholesaler__r.id,Contact_Name__r.Annuity_Territory_Wholesaler__c,Contact_Name__r.Forecare_Territory_Wholesaler__r.id from NIGOs__c  where id in:Trigger.new];

for(NIGOs__c ng:NgList){

if(ng.Product_Type__c != 'Forecare'){

if(ng.Contact_Name__c != Null){

ng.External_Wholesaler__c = ng.Contact_Name__r.Annuity_Territory_Wholesaler__r.id;

}

}

System.debug('Ext1'+ng.External_Wholesaler__c);

}

}
3 Antworten
  1. 30. Okt. 2015, 12:55
    I had taken list instead of Trigger.new because from the __r.id getting null value. So soql the querry to get the value
0/9000