You need to sign in to do that
Don't have an account?
Meeta Khullar 5
Get method not getting data from the Picklist field
I have a visualforce page that has a picklist field "QAD Domain". This is the coding to display the field
<apex:pageBlockSectionItem >
<apex:outputLabel value="QAD Domain"/>
<apex:inputField id="QADDomain" value="{!ord.account.QAD_Domain__c}">
<apex:actionSupport event="onchange" rendered="false">
<apex:param name=" {!domain} " value="{!ord.account.QAD_Domain__c}" assignTo="{!domain}"/>
</apex:actionSupport>
</apex:inputField>
</apex:pageBlockSectionItem>
I have a controller that does the get and set method. When I run the debug log I see there is no value that is passed to the controller for the domain. Can someone point me what correction I need to make to the code in order to get the selected value in the controller.
public String domain {get;set;}
if(domain != null)
mainSoql = mainSoql + ' and Order_Product__r.order.account.QAD_Domain__c = \''+ domain + '\'';
String mainSoql = 'select id,'+
'Name,'+
'Start_Date__c,'+
'End_Date__c,'+
'Order_Product__r.UnitPrice,'+
'Order_Product__r.id,'+
'Order_Product__r.order.account.QAD_Domain__c,'+
'Order_Product__r.order.accountid,'+
'Invoice__r.Orders__r.Name'+
' from Invoice_Line_Items__c where Invoice__r.Status__c= \''+
invoiceStatus+'\' and Unit_Price__c > 0';
<apex:pageBlockSectionItem >
<apex:outputLabel value="QAD Domain"/>
<apex:inputField id="QADDomain" value="{!ord.account.QAD_Domain__c}">
<apex:actionSupport event="onchange" rendered="false">
<apex:param name=" {!domain} " value="{!ord.account.QAD_Domain__c}" assignTo="{!domain}"/>
</apex:actionSupport>
</apex:inputField>
</apex:pageBlockSectionItem>
I have a controller that does the get and set method. When I run the debug log I see there is no value that is passed to the controller for the domain. Can someone point me what correction I need to make to the code in order to get the selected value in the controller.
public String domain {get;set;}
if(domain != null)
mainSoql = mainSoql + ' and Order_Product__r.order.account.QAD_Domain__c = \''+ domain + '\'';
String mainSoql = 'select id,'+
'Name,'+
'Start_Date__c,'+
'End_Date__c,'+
'Order_Product__r.UnitPrice,'+
'Order_Product__r.id,'+
'Order_Product__r.order.account.QAD_Domain__c,'+
'Order_Product__r.order.accountid,'+
'Invoice__r.Orders__r.Name'+
' from Invoice_Line_Items__c where Invoice__r.Status__c= \''+
invoiceStatus+'\' and Unit_Price__c > 0';
<apex:param name=" {!domain} " value="{!ord.account.QAD_Domain__c}" assignTo="{!domain}"/>
to
<apex:param name="domainName" value="{!ord.account.QAD_Domain__c}" assignTo="{!domain}"/>
In your controller side you can directly access the value of the domain field in Account as below,
if(ord.account.QAD_Domain__c != null){
mainSoql = mainSoql + ' and Order_Product__r.order.account.QAD_Domain__c = \''+ ord.account.QAD_Domain__c+ '\'';
String mainSoql = 'select id,'+
'Name,'+
'Start_Date__c,'+
'End_Date__c,'+
'Order_Product__r.UnitPrice,'+
'Order_Product__r.id,'+
'Order_Product__r.order.account.QAD_Domain__c,'+
'Order_Product__r.order.accountid,'+
'Invoice__r.Orders__r.Name'+
' from Invoice_Line_Items__c where Invoice__r.Status__c= \''+
invoiceStatus+'\' and Unit_Price__c > 0';
}
Let me know if you have any questions.
Thanks,
Priyanka S