• Irfan Khan 14
  • NEWBIE
  • 25 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
hi, I have a following code, which updates all child records when status changes from complete to not complete. but my code is not woking.
trigger status on Product__c (after update) {
    set<String> productId = new set<String>();
    for(Product__c pro : trigger.old){
        if(pro.Status__c == 'Complete'){
            productId.add(pro.id);
            System.debug('Completed--->'+pro);
        }    
    }
    List<Vehicle__c> vechicalList = new List<Vehicle__c>();
    for(Vehicle__c vech:[select id,name,Status__c,Product__r.Status__c from Vehicle__c WHERE Product__c IN: productId ]){
        system.debug('vech---->'+vech);
        if(vech.Product__r.Status__c== 'Not Completed'){
            vech.Status__c = 'Incomplete';
            vechicalList.add(vech);
       }
    }
    update vechicalList;
}
Kindlyletme know where I did mistake.
I am trying to send the user an email every time the user uses my app to insert or update a record in salesforce.  

Is Fuel the SDK I should be using?

Also, when I am updating different tables, is there standard email format that will be sent out from Fuel?  or should I construct different message depending on each table?

thanks.
hi, I have a following code, which updates all child records when status changes from complete to not complete. but my code is not woking.
trigger status on Product__c (after update) {
    set<String> productId = new set<String>();
    for(Product__c pro : trigger.old){
        if(pro.Status__c == 'Complete'){
            productId.add(pro.id);
            System.debug('Completed--->'+pro);
        }    
    }
    List<Vehicle__c> vechicalList = new List<Vehicle__c>();
    for(Vehicle__c vech:[select id,name,Status__c,Product__r.Status__c from Vehicle__c WHERE Product__c IN: productId ]){
        system.debug('vech---->'+vech);
        if(vech.Product__r.Status__c== 'Not Completed'){
            vech.Status__c = 'Incomplete';
            vechicalList.add(vech);
       }
    }
    update vechicalList;
}
Kindlyletme know where I did mistake.