You need to sign in to do that
Don't have an account?
![CosC CosC](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Jquery in Visualforce page with where Clause is not working
Jquery in visualforce page without where clause is working fine. But when i add a where clause to select closed Case's is not working.
Code that Call getall cases:
var Case = new SObjectData();
Case.errorHandler = displayError;
$j(document).ready(function() {
regBtnClickHandlers();
getAllCase('Closed');
});
Below is my code for Jquery:
function getAllCase(sreas) {
Case.fetch('soql','SELECT Id, AccountId, CaseNumber, OwnerId, Reason, Status, Subject, Description, ContactId, Priority, Origin from Case WHERE Status = '+sreas+' Order by CaseNumber asc ',function() {
showCase(Case.data());
});
}
Please let me know what is wrong in this query
Code that Call getall cases:
var Case = new SObjectData();
Case.errorHandler = displayError;
$j(document).ready(function() {
regBtnClickHandlers();
getAllCase('Closed');
});
Below is my code for Jquery:
function getAllCase(sreas) {
Case.fetch('soql','SELECT Id, AccountId, CaseNumber, OwnerId, Reason, Status, Subject, Description, ContactId, Priority, Origin from Case WHERE Status = '+sreas+' Order by CaseNumber asc ',function() {
showCase(Case.data());
});
}
Please let me know what is wrong in this query
As it is now, your query looks like:
Pretty sure it needs to be this, with the 'Closed' wrapped in quotes:
So your final code probably needs to be this:
var sreas = UserInfo.getUserID();
SELECT Id, AccountId, CaseNumber, OwnerId, Reason, Status, Subject, Description, ContactId, Priority, Origin from Case WHERE OwnerId = \''+sreas+'\' Order by CaseNumber asc