Variable does not exist in method
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
I am trying to pick up the value of a visual text input and validate if it exists in the database, the problem is that it throws me the following error "Variable does not exist: searchDir"
I leave my code (summarized):
Controller extension:
public class Direccion
public string searchDirget; set;
public ApexPages.StandardController controller get; set;
public Direccion(ApexPages.StandardController controller)
this.controller = controller;
@RemoteAction
public static void verificarDireccion()
Account registros = [ SELECT FiscalAddress__c, BillingAddress__c, ShippingAddress__c
FROM Account
WHERE Account.FiscalAddress__c =: searchDir
OR Account.BillingAddress__c =: searchDir
OR Account.ShippingAddress__c =: searchDir
];
if(registros.size() > 0)
else
Visualforce:
<apex:page standardController="Account" extensions="Direccion" id="page">
<apex:inputText id="FiscalAdress" value="!searchDir"/>
visualforce controller-extension remote-action
New contributor
Fabricio Nahuel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
1
down vote
favorite
I am trying to pick up the value of a visual text input and validate if it exists in the database, the problem is that it throws me the following error "Variable does not exist: searchDir"
I leave my code (summarized):
Controller extension:
public class Direccion
public string searchDirget; set;
public ApexPages.StandardController controller get; set;
public Direccion(ApexPages.StandardController controller)
this.controller = controller;
@RemoteAction
public static void verificarDireccion()
Account registros = [ SELECT FiscalAddress__c, BillingAddress__c, ShippingAddress__c
FROM Account
WHERE Account.FiscalAddress__c =: searchDir
OR Account.BillingAddress__c =: searchDir
OR Account.ShippingAddress__c =: searchDir
];
if(registros.size() > 0)
else
Visualforce:
<apex:page standardController="Account" extensions="Direccion" id="page">
<apex:inputText id="FiscalAdress" value="!searchDir"/>
visualforce controller-extension remote-action
New contributor
Fabricio Nahuel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am trying to pick up the value of a visual text input and validate if it exists in the database, the problem is that it throws me the following error "Variable does not exist: searchDir"
I leave my code (summarized):
Controller extension:
public class Direccion
public string searchDirget; set;
public ApexPages.StandardController controller get; set;
public Direccion(ApexPages.StandardController controller)
this.controller = controller;
@RemoteAction
public static void verificarDireccion()
Account registros = [ SELECT FiscalAddress__c, BillingAddress__c, ShippingAddress__c
FROM Account
WHERE Account.FiscalAddress__c =: searchDir
OR Account.BillingAddress__c =: searchDir
OR Account.ShippingAddress__c =: searchDir
];
if(registros.size() > 0)
else
Visualforce:
<apex:page standardController="Account" extensions="Direccion" id="page">
<apex:inputText id="FiscalAdress" value="!searchDir"/>
visualforce controller-extension remote-action
New contributor
Fabricio Nahuel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I am trying to pick up the value of a visual text input and validate if it exists in the database, the problem is that it throws me the following error "Variable does not exist: searchDir"
I leave my code (summarized):
Controller extension:
public class Direccion
public string searchDirget; set;
public ApexPages.StandardController controller get; set;
public Direccion(ApexPages.StandardController controller)
this.controller = controller;
@RemoteAction
public static void verificarDireccion()
Account registros = [ SELECT FiscalAddress__c, BillingAddress__c, ShippingAddress__c
FROM Account
WHERE Account.FiscalAddress__c =: searchDir
OR Account.BillingAddress__c =: searchDir
OR Account.ShippingAddress__c =: searchDir
];
if(registros.size() > 0)
else
Visualforce:
<apex:page standardController="Account" extensions="Direccion" id="page">
<apex:inputText id="FiscalAdress" value="!searchDir"/>
visualforce controller-extension remote-action
visualforce controller-extension remote-action
New contributor
Fabricio Nahuel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Fabricio Nahuel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Fabricio Nahuel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 hours ago


Fabricio Nahuel
61
61
New contributor
Fabricio Nahuel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Fabricio Nahuel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Fabricio Nahuel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
searchDir
is an instance variable. It is bound to a specific instance of the class Direccion
- here, the controller extension.
static
methods, such as @RemoteAction
JavaScript remoting actions, aren't bound to a specific instance and have no access to the instance variables of the Visualforce page's controller. As such, all state must be passed to the remote action as parameters.
You need to modify the signature of your @RemoteAction
method to
public static void verificarDireccion(String searchDir) {
and alter your Visualforce page's call to the method correspondingly, to pass the current value of this state variable directly to the method.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
searchDir
is an instance variable. It is bound to a specific instance of the class Direccion
- here, the controller extension.
static
methods, such as @RemoteAction
JavaScript remoting actions, aren't bound to a specific instance and have no access to the instance variables of the Visualforce page's controller. As such, all state must be passed to the remote action as parameters.
You need to modify the signature of your @RemoteAction
method to
public static void verificarDireccion(String searchDir) {
and alter your Visualforce page's call to the method correspondingly, to pass the current value of this state variable directly to the method.
add a comment |Â
up vote
3
down vote
searchDir
is an instance variable. It is bound to a specific instance of the class Direccion
- here, the controller extension.
static
methods, such as @RemoteAction
JavaScript remoting actions, aren't bound to a specific instance and have no access to the instance variables of the Visualforce page's controller. As such, all state must be passed to the remote action as parameters.
You need to modify the signature of your @RemoteAction
method to
public static void verificarDireccion(String searchDir) {
and alter your Visualforce page's call to the method correspondingly, to pass the current value of this state variable directly to the method.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
searchDir
is an instance variable. It is bound to a specific instance of the class Direccion
- here, the controller extension.
static
methods, such as @RemoteAction
JavaScript remoting actions, aren't bound to a specific instance and have no access to the instance variables of the Visualforce page's controller. As such, all state must be passed to the remote action as parameters.
You need to modify the signature of your @RemoteAction
method to
public static void verificarDireccion(String searchDir) {
and alter your Visualforce page's call to the method correspondingly, to pass the current value of this state variable directly to the method.
searchDir
is an instance variable. It is bound to a specific instance of the class Direccion
- here, the controller extension.
static
methods, such as @RemoteAction
JavaScript remoting actions, aren't bound to a specific instance and have no access to the instance variables of the Visualforce page's controller. As such, all state must be passed to the remote action as parameters.
You need to modify the signature of your @RemoteAction
method to
public static void verificarDireccion(String searchDir) {
and alter your Visualforce page's call to the method correspondingly, to pass the current value of this state variable directly to the method.
answered 2 hours ago


David Reed
20.1k21640
20.1k21640
add a comment |Â
add a comment |Â
Fabricio Nahuel is a new contributor. Be nice, and check out our Code of Conduct.
Fabricio Nahuel is a new contributor. Be nice, and check out our Code of Conduct.
Fabricio Nahuel is a new contributor. Be nice, and check out our Code of Conduct.
Fabricio Nahuel is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f232768%2fvariable-does-not-exist-in-method%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password