• Salesforce Developer MO
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 3
    Replies

We are using the standard Account.ParentId field to relate parent Accounts to child Accounts. I'd like to add a related list on the Account detail page to show the related Accounts but am not finding a list that I can add on the Edit Layout page. Where can I find the related list? If this isn't possible Im guessing I'll need to add a new custom field in order to get the related list. Hopefully this isn't the case. All suggestions are appreciated. Thanks!

 

Hello all,

 

Im having an issue getting my test class to execute the getRecords() method. The error is a dereference null value on the line where that method is used. How do I get it to recognize the value Im trying to pass into the controller from the test class?

 

@isTest
private class TestSalesConnectContactQuickBuild {

    static testMethod void myUnitTest() {
    	
    	Unmatched_Contact__c contactRecord = new Unmatched_Contact__c(Last_Name__c='TESTDATA',OwnerId=UserInfo.getUserId(),Firm_Internal_ID__c='1');
    	insert contactRecord;
    	
    	Test.startTest();

        ApexPages.Standardcontroller stdCtrl = new ApexPages.Standardcontroller(contactRecord);
        
        SalesConnectContactQuickBuildController controller = new SalesConnectContactQuickBuildController(stdCtrl);
        
        Test.stopTest();
    }
}

 

Here is the controller code...

 

public class SalesConnectContactQuickBuildController {

    ApexPages.StandardController setController;

    public list<Unmatched_Contact__c> unmatchedContactsSelected {get;set;}
    
    public SalesConnectContactQuickBuildController (ApexPages.StandardController controller) {
        setController = controller;
        unmatchedContactsSelected = new list<Unmatched_Contact__c>(); 
        //****ERROR OCCURS ON LINE BELOW - DEREFERENCE NULL VALUE*** 
	unmatchedContactsSelected.add((Unmatched_Contact__c)setCon.getRecord());
        init();
    }
	...
}

 

 

 

 

Hello,

 

Im receiving the error in the subject line. Im trying to loop through records in a custom object and load them into the Contact object. Here is the code...

 

public list<Contact> contactInsertItem {get;set;}
public list<Contact> contactInsertList {get;set;}

public SalesConnectContactQuickBuildController (ApexPages.StandardSetController controller) {
...
	List<CustomObject1__c> unmatchedContactList = new List<CustomObject1__c>([SELECT field1__c, field2__c, field3__c FROM CustomObject1__c WHERE Id in :tempSet]);
	
	for(integer i=0; i<unmatchedContactList.size();i++){
			
        	contactInsertItem = new list<Contact>();
        	//***error occurs here*** contactInsertItem.field1__c = unmatchedContactList[i].field1__c;
        	contactInsertItem.field2__c = unmatchedContactList[i].field2__c;
        	contactInsertItem.field3__c = unmatchedContactList[i].field3__c;
        	contactInsertItem.field4__c = unmatchedContactList[i].field4__c;
        	contactInsertItem.field5__c = unmatchedContactList[i].field5__c;
			
		contactInsertList.add(contactInsertItem);
	}
...
}

 What am I doing incorrectly?

Hello,

 

Im trying to display help text in a custom VF page, my code is below. I get an empty string even though the field has help text set on it. On line 2, the result is empty as well, I just wanted to see if anything would output from the $ObjectType reference but it does not.

 

Ive read through several other articles about this issue and the popular thing seems to be using an HTML workaround. I would prefer to use straight VisualForce if possible. Anyone know?

 

CODE

 

<apex:page Controller="MyController" sidebar="true" showHeader="true" standardStylesheets="true">
<apex:outputPanel >|{!$ObjectType.MyCustomObject__c.Fields.MyCustomField__c.inlineHelpText}|</apex:outputPanel> 
<apex:tabPanel switchType="client"  value="{!TabInFocus}" id="theTabPanel">
<apex:tab label="Integration Options" name="Integration" id="tabOne">


  <apex:form >
   <apex:pageBlock mode="edit">

     <apex:pageBlockSection columns="2" title="Contact Settings" > 
            <apex:pageBlockSectionItem HelpText="{!$ObjectType.MyCustomObject__c.Fields.MyCustomField__c.inlineHelpText}">
            <apex:outputLabel value="{!$ObjectType.MyCustomObject__c.Fields.MyCustomField__c.label}" style="white-space:nowrap;"/>
            <apex:inputField value="{!salesConnectSetting.MyCustomField__c}"/>
            </apex:pageBlockSectionItem>

 

Hi,

 

How do I make a custom field on a custom object available to a related list of a standard object. Is this possible?

 

Thanks ahead of time.

 

We are using the standard Account.ParentId field to relate parent Accounts to child Accounts. I'd like to add a related list on the Account detail page to show the related Accounts but am not finding a list that I can add on the Edit Layout page. Where can I find the related list? If this isn't possible Im guessing I'll need to add a new custom field in order to get the related list. Hopefully this isn't the case. All suggestions are appreciated. Thanks!

 

Hello all,

 

Im having an issue getting my test class to execute the getRecords() method. The error is a dereference null value on the line where that method is used. How do I get it to recognize the value Im trying to pass into the controller from the test class?

 

@isTest
private class TestSalesConnectContactQuickBuild {

    static testMethod void myUnitTest() {
    	
    	Unmatched_Contact__c contactRecord = new Unmatched_Contact__c(Last_Name__c='TESTDATA',OwnerId=UserInfo.getUserId(),Firm_Internal_ID__c='1');
    	insert contactRecord;
    	
    	Test.startTest();

        ApexPages.Standardcontroller stdCtrl = new ApexPages.Standardcontroller(contactRecord);
        
        SalesConnectContactQuickBuildController controller = new SalesConnectContactQuickBuildController(stdCtrl);
        
        Test.stopTest();
    }
}

 

Here is the controller code...

 

public class SalesConnectContactQuickBuildController {

    ApexPages.StandardController setController;

    public list<Unmatched_Contact__c> unmatchedContactsSelected {get;set;}
    
    public SalesConnectContactQuickBuildController (ApexPages.StandardController controller) {
        setController = controller;
        unmatchedContactsSelected = new list<Unmatched_Contact__c>(); 
        //****ERROR OCCURS ON LINE BELOW - DEREFERENCE NULL VALUE*** 
	unmatchedContactsSelected.add((Unmatched_Contact__c)setCon.getRecord());
        init();
    }
	...
}

 

 

 

 

Hello,

 

Im trying to display help text in a custom VF page, my code is below. I get an empty string even though the field has help text set on it. On line 2, the result is empty as well, I just wanted to see if anything would output from the $ObjectType reference but it does not.

 

Ive read through several other articles about this issue and the popular thing seems to be using an HTML workaround. I would prefer to use straight VisualForce if possible. Anyone know?

 

CODE

 

<apex:page Controller="MyController" sidebar="true" showHeader="true" standardStylesheets="true">
<apex:outputPanel >|{!$ObjectType.MyCustomObject__c.Fields.MyCustomField__c.inlineHelpText}|</apex:outputPanel> 
<apex:tabPanel switchType="client"  value="{!TabInFocus}" id="theTabPanel">
<apex:tab label="Integration Options" name="Integration" id="tabOne">


  <apex:form >
   <apex:pageBlock mode="edit">

     <apex:pageBlockSection columns="2" title="Contact Settings" > 
            <apex:pageBlockSectionItem HelpText="{!$ObjectType.MyCustomObject__c.Fields.MyCustomField__c.inlineHelpText}">
            <apex:outputLabel value="{!$ObjectType.MyCustomObject__c.Fields.MyCustomField__c.label}" style="white-space:nowrap;"/>
            <apex:inputField value="{!salesConnectSetting.MyCustomField__c}"/>
            </apex:pageBlockSectionItem>