0

enter image description hereDidn't understand relationship 'Job application ' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names....Than i want to compare AccList value with Possition list

in my first query i am trying to get all the potions.In second query i want to find the position for those job is created this month . 3rd step i have to filter out those position for those job is not created .. and though batch job i have to create jobs for that month... position and jobs are just dummy objects(in my case it is case and custom object)

 List<Possition__c> AllPossiton =[select id from position__c limit 200];

    List<Possition__c> AccList = new List<Possition__c>([SELECT id,Name,(SELECT Possition__cId,Month__c,Week__c,Year__c,RecordTypeId,Possition__c FROM JobAppliaction__c where (RecordTypeId =:rtype) and (CALENDAR_MONTH(CreatedDate) = :month) and (CALENDAR_YEAR(CreatedDate) = :year)) FROM Possition__c WHERE Name IN (SELECT Possition__cid FROM JobAppliaction__c)]);
If(AllPossiton.contains(AccList );
{}
2
  • [select id from position limit 200]; this wont even compile, can you use proper API names?. What do you want? Position with Job Applications? Nov 8, 2019 at 10:03
  • in my first query i am trying to get all the potions.In second query i want to find the position for those job is created this month . 3rd step i have to filter out those position for those job is not created .. and though batch job i have to create jobs for that month... position and jobs are just dummy objects(in my case it is case and custom object)
    – Priya
    Nov 8, 2019 at 10:15

2 Answers 2

0

Please read the SOQL reference documentation about relationship queries. This should clarify how you should use the JobApplication__r (or whatever it is called) relationship in the subqueries (nested selects).

0

When you select child records, you should write their API name in a different way. The name is specified when you create the lookup or master-detail field on child object(in the field settings). Also, if child is a Custom Object it should have "__r" postfix. Also, check spelling :)

1
  • Just checked - if the lookup is to a Custom Object - you should append "__r", even if the lookup field is on a Standard Object, so it should be "Cases__r" Nov 8, 2019 at 14:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .