You need to sign in to do that
Don't have an account?
John Neilan 18
Custom Controller Question
Hi,
I have a simple Visualforce page with 3 fields that launches from a controller method related to another VF page. The page loads properly using the controller below, but I am trying to pre-populate the Contact and Account records that are the master part of the custom object master-detail relationship. Can anyone advise how I can do this?
I have a simple Visualforce page with 3 fields that launches from a controller method related to another VF page. The page loads properly using the controller below, but I am trying to pre-populate the Contact and Account records that are the master part of the custom object master-detail relationship. Can anyone advise how I can do this?
public class NewObjController { Engage__c eng = new Engage__c(); public list<Engage__c> listEngage{ get; set; } public NewObjController() { listEngage=new list<Engage__c>(); listEngage.add(eng); } Public void addEngage() { Engage__c eng1 = new Engage__c(); listEngage.add(eng1); } public PageReference saveEngage() { for(Integer i=1; i<listEngage.size(); i++) { insert listEngage; } } }
Greetings!
You need to assign the value for those fields which you would like to pre-populate on VF page in the controller something like given in the below thread:
https://developer.salesforce.com/forums/?id=906F000000096KRIAY
Another example:https://developer.salesforce.com/forums/?id=906F0000000g28zIAA
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri
All Answers
Greetings!
You need to assign the value for those fields which you would like to pre-populate on VF page in the controller something like given in the below thread:
https://developer.salesforce.com/forums/?id=906F000000096KRIAY
Another example:https://developer.salesforce.com/forums/?id=906F0000000g28zIAA
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri