Activity Forums Salesforce® Discussions how to avoid this salesforce error

  • how to avoid this salesforce error

    Posted by sfdc on July 23, 2017 at 1:23 pm

    Database.query error getting Events! Exception: unexpected token: 'FROM'
    SELECT Id,Name, geolocation__c,Location__c, geolocation__Latitude__s , geolocation__Longitude__s, Date_of_Onsite_Event__c, Local_Start_Time_of_Event__c, Local_End_Time__c,Local_End_Time_of_Event__c, Number_of_Hours_of_Event__c, End_Date_of_Onsite_Event__c, Services_to_be_Provided__c,( SELECT Id, Contact__c,Contact__r.Provider_Level__c, FROM Provider_Onsite_Event__r where Contact__r.Provider_Level__c =:'Coordinator- Level 1 ), FROM Onsite_Event__c WHERE Publish__c = 'Yes' AND Date_of_Onsite_Event__c > TODAY AND DISTANCE(geolocation__c, GEOLOCATION(13.5603,78.5036),'mi') < 100 ORDER BY DISTANCE(geolocation__c, GEOLOCATION(13.5603,78.5036),'mi') LIMIT 50

    shariq replied 7 years, 4 months ago 3 Members · 2 Replies
  • 2 Replies
  • saloni gupta

    Member
    July 24, 2017 at 4:55 am

    Hi shiva,

    try the plural  name of child object in sub query.

  • shariq

    Member
    August 3, 2017 at 11:47 am

    Hi sfdc,

    Check your Child Relationship Name, you can check by following steps :-

    1. Go to the view fields section of that sobject.

    2.Click the field label that you want to check(Master Detail or LookUp field).

    3.There you will get the Child Relationship Name, use it to your query.

    Hope this helps.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos