You need to sign in to do that
Don't have an account?
Abel Palma
I need help here, I need to pass parameters to a class
I´m using SelectOption (a kind of picklist) in an Apex page, I need to pass the parameter to other class with a button (a submit)
This is my visual Force Page:
<apex:page lightningStylesheets="true" ><!--extensions="WebServiceController"-->
<apex:form>
<apex:pageBlock title='Employee id'>
<apex:pageBlockSection>
<apex:selectList id="AccountsClients" Title="Accounts ids" size="1">
<apex:selectoption itemLabel="Account 1" itemValue="D0000001"></apex:selectoption>
<apex:selectoption itemLabel="Account 2" itemValue="D0000002"></apex:selectoption>
<apex:selectoption itemLabel="Account 3" itemValue="D0000003"></apex:selectoption>
<apex:selectoption itemLabel="Account 4" itemValue="D0000004"></apex:selectoption>
<apex:selectoption itemLabel="Account 5" itemValue="D0000005"></apex:selectoption>
</apex:selectList>
</apex:pageBlockSection>
<apex:pageBlockButtons>
<apex:commandButton value="Register" id="SubmitButton" action="{!IdCuentas}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
This is the class that needs to receive the parameter
public class WebserviceClass{
public HttpResponse WebserviceClss (String numeroCliente){
Http http = new Http();
HttpRequest request = new HttpRequest();
getClientes__c customSetting= getClientes__c.getValues('saveAccount');
request.setEndpoint(customSetting.URL__c + numeroCliente);
request.setMethod('GET');
system.debug(customSetting.URL__c);
HttpResponse response = http.send(request);
system.debug(response);
return response;
}
}
This is my visual Force Page:
<apex:page lightningStylesheets="true" ><!--extensions="WebServiceController"-->
<apex:form>
<apex:pageBlock title='Employee id'>
<apex:pageBlockSection>
<apex:selectList id="AccountsClients" Title="Accounts ids" size="1">
<apex:selectoption itemLabel="Account 1" itemValue="D0000001"></apex:selectoption>
<apex:selectoption itemLabel="Account 2" itemValue="D0000002"></apex:selectoption>
<apex:selectoption itemLabel="Account 3" itemValue="D0000003"></apex:selectoption>
<apex:selectoption itemLabel="Account 4" itemValue="D0000004"></apex:selectoption>
<apex:selectoption itemLabel="Account 5" itemValue="D0000005"></apex:selectoption>
</apex:selectList>
</apex:pageBlockSection>
<apex:pageBlockButtons>
<apex:commandButton value="Register" id="SubmitButton" action="{!IdCuentas}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
This is the class that needs to receive the parameter
public class WebserviceClass{
public HttpResponse WebserviceClss (String numeroCliente){
Http http = new Http();
HttpRequest request = new HttpRequest();
getClientes__c customSetting= getClientes__c.getValues('saveAccount');
request.setEndpoint(customSetting.URL__c + numeroCliente);
request.setMethod('GET');
system.debug(customSetting.URL__c);
HttpResponse response = http.send(request);
system.debug(response);
return response;
}
}
All Answers
I wanted to add more colums to one particluar view, any help on how I can achieve