• ALISHA nagarkar 10
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Can some one help me with intergration of MS NAV with saleforce using Rest API
1)When user open the system can capture the latitude and longitude of gps in the system
2)When next time they log a call system to validate the location 
1)When user open the system can capture the latitude and longitude of gps in the system
2)When next time they log a call system to validate the location 
Hi All,

Please bear with me. I am an APEX newbie and needed some assistance please.

Goal: I wanted to update the checkbox (SentForApproval__c) in Child Object (Rate_sheet__c) to TRUE if the Parent Record (Lead) Status (Lead_Status_NEW__c) was set to "CA Completed". This is a lookup relationship.

Parent Object: Lead
Child Object: Rate_sheet__c

Here's what I have so far and I am unsure how to complete the code or even correct this:
 
trigger CAforApproval on Lead (after update){

	set<Id> leadIds = new set<Id>();
    	map<Id, Lead> mapLead = new map<Id, Lead>();
    	list<Rate_sheet__c> listRateSheet = new list<Rate_sheet__c>();
    
    	for(Lead lead : trigger.new) {
        	leadIds.add(lead.Id);
        	mapLead.put(lead.Id, lead);
        }
    
   	 listRateSheet = [SELECT SentForApproval__c,  Lead__r.Id  FROM Rate_sheet__c WHERE Lead__r.Id  IN : leadIds];
    
    if(listRateSheet.size() > 0) { 
        for(Rate_sheet__c rs : listRateSheet) {

Any help is greatly appreciated. Thank you