You need to sign in to do that
Don't have an account?
Mr.Brooks
Passing input text value from visualforce page to controller
Hi, I am trying to sync my contact on with my account owner but entering the dealer number in through a vf page and passing it to a SOQL query in apex. here is my code:
Page:<apex:page standardController="Contact" extensions="DealerContactOwnerSync" >
<apex:form >
<tabel >
<tr>
<td></td><td>Enter Dealer Number:<apex:inputText value="{!dlrNum}" /></td><br/>
</tr>
<tr>
<td><apex:commandButton value="Sync This Dealer" action="{!dealershipSync}"/></td>
<td></td>
</tr>
</tabel>
</apex:form>
</apex:page>
Controller:
public string dlrNum; //dealer number
public String getdlrNum(){
return dlrNum;
}
public void setdlrNam(String s) {
dlrNum= s;
}
Public void dealershipSync(){
//String branchNumber = ApexPages.currentPages.getParameters.get("branch number");
for(Contact c : [SELECT account.OwnerId, account.Id, account.branch_number__c, account.owner.isActive, account.Active__c, account.Name, account.GMF_ACF__c, Id, OwnerId , Name FROM Contact where end_date__c = null and CreatedDate >= 2008-10-03T00:00:00Z and account.recordtypeid ='01230000000DD54AAG' and account.owner.House_Account__C = false and account.owner.isActive = true and account.active__c = 'Y' and account.dealer_number__c =:dlrNum order by account.LastModifiedDate limit :iContactBatchSize] ){
System.debug('Dealer Number is:***************** ' + dlrNum);
if(c.OwnerID != c.account.OwnerID){
Contact mContact = new Contact();
Page:<apex:page standardController="Contact" extensions="DealerContactOwnerSync" >
<apex:form >
<tabel >
<tr>
<td></td><td>Enter Dealer Number:<apex:inputText value="{!dlrNum}" /></td><br/>
</tr>
<tr>
<td><apex:commandButton value="Sync This Dealer" action="{!dealershipSync}"/></td>
<td></td>
</tr>
</tabel>
</apex:form>
</apex:page>
Controller:
public string dlrNum; //dealer number
public String getdlrNum(){
return dlrNum;
}
public void setdlrNam(String s) {
dlrNum= s;
}
Public void dealershipSync(){
//String branchNumber = ApexPages.currentPages.getParameters.get("branch number");
for(Contact c : [SELECT account.OwnerId, account.Id, account.branch_number__c, account.owner.isActive, account.Active__c, account.Name, account.GMF_ACF__c, Id, OwnerId , Name FROM Contact where end_date__c = null and CreatedDate >= 2008-10-03T00:00:00Z and account.recordtypeid ='01230000000DD54AAG' and account.owner.House_Account__C = false and account.owner.isActive = true and account.active__c = 'Y' and account.dealer_number__c =:dlrNum order by account.LastModifiedDate limit :iContactBatchSize] ){
System.debug('Dealer Number is:***************** ' + dlrNum);
if(c.OwnerID != c.account.OwnerID){
Contact mContact = new Contact();
Are you getting any error messages on the VF page?