function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MDeveloperMDeveloper 

Problem in get data from objects

Hi,

 

I have create an object in force.com when I am trying to fetch that object with repeater in site.com page. It give me an error message like this:-

 

Could not run the query: SELECT ArchivedById,ArchivedDate,ArticleNumber,ArticleType,Article_Image__Body__s,Article_Image__ContentType__s,Article_Image__Length__s,Article_Image__Name__s,Content__c,CreatedById,CreatedDate,FirstPublishedDate,Id,IsDeleted,IsLatestVersion,IsVisibleInApp,IsVisibleInCsp,IsVisibleInPkb,IsVisibleInPrm,KnowledgeArticleId,Language,LastModifiedById,LastModifiedDate,LastPublishedDate,OwnerId,PublishStatus,SourceId,Summary,SystemModstamp,Title,UrlName,ValidationStatus,VersionNumber FROM Article__kav LIMIT 200: MALFORMED_QUERY: MALFORMED_QUERY: Implementation restriction: When querying or searching the Article__kav object, you must filter using the following syntax: Id = [single ID], Id IN [list of ID's] or PublishStatus = [status]. In addition PublishStatus is only permitted in a top-level AND condition.

 

 

 

 

Vinita_SFDCVinita_SFDC

Hello,

 

This error is due to query restriction on the article types, you should add "Language" column and "Publishstatus" column in query. otherwise you will get this error.
 
"Language" column is added in API version 21, so this column is for version 21 and after. If you try to us this language column in version 20, you will get an error of "No column found".
 
For normal SOQL query, You cannot pass dynamic parameters in the "Language" field in where clause. If you want to make your query dynamic w.r.t language field , you need to use dynamic SOQL to make it happen.
 
Example query:  article_1__kav art=[SELECT Title FROM article_1__kav where  language='en_US' and title='Myname' and publishstatus='online' ];
 
Here article_1__kav is your article type.
 
 
There is also an idea about this implementation restriction on article type :