You need to sign in to do that
Don't have an account?
Knowledge Article soql problem
I've run across some odd knowledge article behavior. My KnowledgeAticleVersion soql querys are not working with variable substitution:
// Fails with comile error
String languageCode = 'es';
List<KnowledgeArticleVersion> foo = [select MasterVersionId, Title, Language from KnowledgeArticleVersion where PublishStatus = 'Draft' and Language =: languageCode and IsMasterLanguage = false] ;
// Works fine
List<KnowledgeArticleVersion> foo = [select MasterVersionId, Title, Language from KnowledgeArticleVersion where PublishStatus = 'Draft' and Language = 'es' and IsMasterLanguage = false] ;
Shouldn't the first example work?
Best,
-james
Try to put second and condition in the bracket...What kind of object is this?This must be standard.I have ever use it before:)
Hi,
You are right first option should also work.
Try the below code as reference:
string st='abc';
list<contact>con=[select id from contact where lastname=:st];
system.debug('@@@@@@@@@@@@' + con.size());
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Navatar,
The code you've posted will work. The variable sub issue is only occuring for me with KnowledgeAticleVersion objects, not Contacts.
-jimmy