• Nkosilathi Ncube
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 10
    Replies
On the Contact object I have two Record types "A" and "B", I have created a visualforce page which I want to use for record type A not for both I want to keep B default, please help
"not a valid child relationship name for entity", 
I have a custom object "Placement" which appears on the Contact Object as a related list, I keep geep getting the above error, I have gone into "Placement" and on the relationship and get the relationship name as "Placement1", I have tried to use the __r and even Placement1s__r, I still get "not a valid child relationship name for entity", Please Help
<apex:relatedList subject ={!Contact} list = "Placement1s__r />

 
Hello Community, I have written this trigger to update County field for a particualr postcode, I am getting a NULLPOINTER Exception, please help
trigger TriggerUpdateContact on Contact(before insert, before update) {

    if(RecursiveTriggerHandler.isFirstTime){
        RecursiveTriggerHandler.isFirstTime = false;
}

    // querying all the name and Zipcode from County object
    List<PostCodes__c> countyList = [select Id, PostCode__c, County__c from PostCodes__c];   
   
    Map<String,String > PostCodeMap = new Map<String,String>();       
    
    //populating the Map
    for(PostCodes__c p : countyList ){
           PostCodeMap.put(p.PostCode__c,p.County__c);

       }  
    for (Contact c :Trigger.new){    
    string postcode2;
      
        if (c.MailingPostalCode.length() >= 8) {
                postcode2 = c.MailingPostalCode.substring(0,4);
        } else if (c.MailingPostalCode.length() >= 7)  {
                postcode2 = c.MailingPostalCode.substring(0,3);
        } else {
                postcode2 = c.MailingPostalCode.substring(0,2);
        }  
  
       
        if(c.MailingPostalCode!= null && PostCodeMap.containsKey(postcode2)) {
         c.County__c=PostCodeMap.get(postcode2);
                    
         }else
            c.County__c  = 'Unknown';
            
    
    }}
On the Contact object I have two Record types "A" and "B", I have created a visualforce page which I want to use for record type A not for both I want to keep B default, please help
"not a valid child relationship name for entity", 
I have a custom object "Placement" which appears on the Contact Object as a related list, I keep geep getting the above error, I have gone into "Placement" and on the relationship and get the relationship name as "Placement1", I have tried to use the __r and even Placement1s__r, I still get "not a valid child relationship name for entity", Please Help
<apex:relatedList subject ={!Contact} list = "Placement1s__r />

 
Hello Community, I have written this trigger to update County field for a particualr postcode, I am getting a NULLPOINTER Exception, please help
trigger TriggerUpdateContact on Contact(before insert, before update) {

    if(RecursiveTriggerHandler.isFirstTime){
        RecursiveTriggerHandler.isFirstTime = false;
}

    // querying all the name and Zipcode from County object
    List<PostCodes__c> countyList = [select Id, PostCode__c, County__c from PostCodes__c];   
   
    Map<String,String > PostCodeMap = new Map<String,String>();       
    
    //populating the Map
    for(PostCodes__c p : countyList ){
           PostCodeMap.put(p.PostCode__c,p.County__c);

       }  
    for (Contact c :Trigger.new){    
    string postcode2;
      
        if (c.MailingPostalCode.length() >= 8) {
                postcode2 = c.MailingPostalCode.substring(0,4);
        } else if (c.MailingPostalCode.length() >= 7)  {
                postcode2 = c.MailingPostalCode.substring(0,3);
        } else {
                postcode2 = c.MailingPostalCode.substring(0,2);
        }  
  
       
        if(c.MailingPostalCode!= null && PostCodeMap.containsKey(postcode2)) {
         c.County__c=PostCodeMap.get(postcode2);
                    
         }else
            c.County__c  = 'Unknown';
            
    
    }}