public class Autopopulation {
public apple__c apple{ get; set; }
public String accText { get; set; }
public Autopopulation(ApexPages.StandardController controller) {
this.apple= (apple) controller.getRecord();
if(apple.id != NULL)
{
apple=[SELECT id,Account__c,Contact__c FROM apple__c WHERE id = :apple.Id ];
accText =apple.Id;
}
}
public PageReference passProjectId()
{
String projectId = ApexPages.currentPage().getParameters().get('proId');
System.debug(projectId);
return null;
}
}
Account and contacts are lookup in apple__c object.When i populate account through autocomplete how to populate account related contacts in contact lookup?
How can you auto populate contacts ? If an account has more than one Contact then which will be autopupolated ? However, your extension class has some compiler errors. It can't be save into system.
In your controller you can easilly assign contact id in contact lookup. what issue you are facing ?
You can put a look up filter into the Contact Look up field of your object for which you are implementing the Visualforce page like that,
Please keep in mind you need a look up field with relation to Account Object proior to develop this filter into your Contact look up field.
Now your visualforce page will be like this ,
And it is done. :)
Thanks.
I am trying to like below
Page:
Controller:
Account and contacts are lookup in apple__c object.When i populate account through autocomplete how to populate account related contacts in contact lookup?
How can you auto populate contacts ? If an account has more than one Contact then which will be autopupolated ? However, your extension class has some compiler errors. It can't be save into system.