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
magalie pickertmagalie pickert 

Invalid type: QueryResult --- Apex API Librairies

Hi,

i want to create a query in my apex class...

I become this failure: Invalid type: sforce.QueryResult

If i try to add import i become also a failure:
Invalid type: sforce.QueryResult

How can i add in my code that i'm using salesforce apex librairie?

Thx
jrotensteinjrotenstein
It appears that you are mixing APIs.

sforce.QueryResult is used in JavaScript to call Salesforce via AJAX.

If you wish to create a query in Apex, you can do it in-line, eg:

List<Account>aa=[selectid,namefromaccountwherename='Acme'];

I would recommend the Force.com Cookbook for learning Apex syntax.
magalie pickertmagalie pickert
Hi,

thx u...
I change that yesterday...
I had to change my code wo was 6 months old...

But thx for your quickly answer