whats the number of times the letter _ appears in:
q: old and new values of parent fields with re-parenting on child trigger i know we have to query the parent fields to access them on the child object trigger. how can i get the old and new values of the parent fields when its parent record has been changed. i have two objects. 


*

*case (child of look-up to webid object)

*webid 


i need to access old and new value of the status__c custom field on webid__c whenever case gets its parent webid changed. any inputs on the single line logic to retrieve the old and new values of parent field webid__r.status__c? 
thanks in advance!

a: i would recommend creating a map of webids to its status by querying the webid object after creating a set from the old and new ids using the webid__c field from the old/new child records. then you can use that map to access the status of the webid record based on the id of the old record vs the new record.

a: from the above @jennyb answer, here is the code below.
trigger casetrigger on case(before update)
{
  set<id> newset = new set<id>(); 
  set<id> oldset = new set<id>();
  for(case cs:trigger.new)
  {
     newset.add(cs.webid__c);
  }
  for(case cs:trigger.old)
  {
     oldset.add(cs.webid__c);
  }
  map<id, webid__c> allwebidmap = new map<id, webid__c>(
                    [select id, status__c from webid__c where id in: newset 
                    or id in:oldset]);
  map<id, webid__c> newwebidmap = new map<id, webid__c>();
  map<id, webid__c> oldwebidmap = new map<id, webid__c>();

  for(id webidid : allwebidmap.keyset()) 
  {
      webid__c currentwebid = allwebidmap.get(webidid);
     if(newset.contains(webidid)) 
     { 
          newwebidmap.put(webidid, currentwebid); 
     }
     if(oldset.contains(webidid)) 
     { 
          oldwebidmap.put(webidid, currentwebid); 
     }
  }

  for(case c:trigger.new)
  {
     string oldstatus = oldwebidmap.get(trigger.oldmap.get(c.id).webid__c).status__c;
     string newstatus = newwebidmap.get(c.webid__c).status__c;
     system.debug(---------oldstatus----------+oldstatus);
     system.debug(---------newstatus----------+newstatus); 
     // perform required operation here  

  }
}  


user
There are 40 "_"s in the text you provided.
assistant