Skip to main content
Nagendra Singh perguntou em #Apex
Hi there, need help, I wrote a query that returns 3 records. and I'm reading those records in the FOR loop to update record that matchs criteria, however this record iteration no happening, anything I'm missing in following code:

my question is, I put a debug before if, I epxcet 3 entries in the log but it just one.

List <Sales_Team__c> gst = [Select Sales_Team_Member__c,Primary__c,Producer__c,Opportunity__c,Email__c,Id

                                             From Sales_Team__c

                                             Where Sales_Team_Member__c IN: opportunityIdSet and  Producer__c = null];

for (Sales_Team__c OpptyGST : gst){

                     system.debug('Test GST Memebr⌗ : ' + OpptyGST.Sales_Team_Member__c);                            

                if (OpptyGST.Sales_Team_Member__c == Oppty.Sales_Rep__c){

                    OpptyGST.Primary__c = true;

                    OpptyGST.Email__c = 'primary@gst.com';

                   

                } 

}

 
4 respostas
0/9000