• Harsh Dwivedi
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies

I have a two Custom field's source and destination both are of string types and store name of cities i wanted to calculate rough distance between them and show the route on the map how can i do that? also I wanted to use the 3rd party webapplication's functionality to convert address to latitude and longitude??

error :- First exception on row 0 with id 0012v00002J69maAAB; first error: SELF_REFERENCE_FROM_TRIGGER, Object (id = 0012v00002J69ma) is currently in trigger isdead, therefore it cannot recursively update itself: []: Trigger.isdead: line 43, column 1.

Code-
trigger isdead on Account (before insert,before update) {
    
    list <Account> up=new list<Account>();
    
    Set<Id> stdIds = new Set<Id>();
    for(Account ac : Trigger.new)
    {
        stdIds.add(ac.Id);
    }
    List<contact> contactlist = new List<Contact>();
        integer x=0;
        List<Account> Act =[select id from Account where Id in :stdIds];
        System.debug(Act);
        for(Account A : Act)
        {
           contactlist=[select Id,Dead__c from Contact where AccountId =:A.Id];
            x=0;
           system.debug(contactlist);
            for(Contact c:contactlist){
                if(c.Dead__c==true){
                    system.debug('here');
                    x++;
                }
            }
            
            system.debug('value of x='+x);
            system.debug(contactlist.size());
            
            if(x>contactlist.size()){
                A.need_intel__c=true;
            
            }
            else{
                A.need_intel__c=false;
                
            }
 
            up.add(A);

            
        }
  
      ------->  update up; // code gets stuck at this point cannot really                                              figure it out why 
       
        
    }
Hello Friends 
In my API response i am getting String Field Date_modified=08/23/2019
i would grab this field and assigning to Datetime Field called Acct_Modifieddate.
Datetime Acct_Modifieddate =date.parse(Date_modified);
In the log i see Acct_Modifieddate as 2019-08-23 00:00:00.
And finally i would be pushing this field to another Datetime custom field via process builder.
In the Salesforce UI i see this field populated as 8/22/2019 5:00 PM

Please advice whether this problem related to GMT timezone issue or something else.

Thanks