Skip to main content
@RestResource(urlMapping='/v1/BookDetails/')

global class bookManager 

{

@httpGet

global static Book__c doGetBook()

{

    Book__c book = new Book__c();

    Map<String,String> paramsMap = RestContext.request.params;

    String bookId = paramsMap.get('Id');

    book = [select Id, Name, Price__c from Book__c where Id IN =: bookId]; // getting sytax error in this line

    return book;

}

}
4 respostas
  1. 21 de jan. de 2021, 12:03
    your have both equals (=) and IN in your SELECT statement.  Need one or the other

    so try:

    book = [select Id, Name, Price__c from Book__c where Id = : bookId];

    regards

    Andrew​​​​​​​
0/9000