• t.sells
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I hope this is an easy one. I want to create a VF page that will allow the user to look up a record for a custom object so that I can pass that record's ID to another class to perform an operation on it when user clicks the command button. I want the input box on the page to have the same behavior as that of a lookup field.

The use-case on this is similar to if I wanted to transfer all contacts for one account to another account. I would want the VF page to receive the source account's ID so the process could find all the contacts, but I want the use to be able to lookup the destination account from the page.

If anyone can point me in the right direction on this, it would be much appreciated. Thanks.

Todd

I am coming from a .NET environment, and I am having some trouble with the OO particulars of Apex. I want to create a class that is extended from a base class that implements an interface. In my example, the interface, base class and class are in separate files.

My main question is in regards to accessing functions and variables in the base class. Since I have to explicitly reference the base class name and the function (which has to be public?) what is the point of using the “extended” modifier, since I can accomplish the same without it? Also, I really want the base class variables and to be private, or at least protected, in the implementation of the interface, but it doesn’t allow me to do that.

Any links, references or advice would be greatly appreciated. Thanks!

- Todd

public interface SC_IProcess {
	void execute();
	void initialize();
}


public with sharing virtual class SC_ProcessBase implements SC_IProcess {
	
	public static sObject somesobject; 	
		
	public virtual void execute(){
		
	}
	
	public virtual void initialize(){
		
	}
	
	public static void UpdateValues(){
		system.debug('Updating Values');
		upsert somesobject;		
	}

}


public with sharing class SCTemplate extends SC_ProcessBase {
	public void SCTemplate(){
		initialize();
		execute();
	}
	
	public override void execute(){
		SC_ProcessBase.UpdateValues(); 				
	}
	
	public override void initialize(){
		somesobject = new account(name='my name');	
	}
}

 

 

 

We are using Person Accounts and have found that all the views and related lists display the Account Name in the form of FirstName LastName.  However the views on the Account Tab display the name as LastName, FirstName (which is what we want).

 

Is there a setting that will allow me to make this display consistent for the views and lists on related objects?  Thanks.

 

Todd 

Hi,

 

I am new to development with APEX, and while I familiar with how to test and deploy code with Eclipse, I was wondering if it is possible to test and deploy from the Developer Console (from our sandbox to our production org). 

 

If someone could post a link to a walk-through on this, if it is possible, I would be very grateful.  Thanks!

 

TCS

Hi,

I have a custom object, MIS_Job__c that is a child relationship for Account. The APEX documentation says the following should work:

 

insert new Account(Name='Joe Smit', MIS_Jobs__r = new MIS_Job__c( Category__c='XXX', Status__c='ZZZ'));

 

However, when I do this, I get a compile error "Field is not writeable: MIS_Jobs__r"

All I am trying to do is create parent/child objects for a test case. Thank you for any help you can provide.

Hi,

 

I am new to development with APEX, and while I familiar with how to test and deploy code with Eclipse, I was wondering if it is possible to test and deploy from the Developer Console (from our sandbox to our production org). 

 

If someone could post a link to a walk-through on this, if it is possible, I would be very grateful.  Thanks!

 

TCS