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
Varun Sharma 150Varun Sharma 150 

SOQL to Get All Service Appointments scheduled to Preferred / Required Service Resources

HI,
I am looking to get an SOQL which can help to find all service Appointment which are scheduled to Preferred / Requried Service Resources. I am looking for a SOQL including ServiceAppointment, WorkOrder and WorkType.

 
Best Answer chosen by Varun Sharma 150
AnudeepAnudeep (Salesforce Developers) 
Hi Varun,

 Can you try something like this? 

SELECT Id, Status, ParentRecordId,ParentRecordType,WorkTypeId FROM ServiceAppointment where Status IN ('Preferred', 'Required Service') AND ParentRecordType = 'Workorder'

User-added image

Anudeep

 

All Answers

AnudeepAnudeep (Salesforce Developers) 
Hi Varun,

 Can you try something like this? 

SELECT Id, Status, ParentRecordId,ParentRecordType,WorkTypeId FROM ServiceAppointment where Status IN ('Preferred', 'Required Service') AND ParentRecordType = 'Workorder'

User-added image

Anudeep

 
This was selected as the best answer
Varun Sharma 150Varun Sharma 150
Thought it was not exacty I was looking however it helped me to achieve ultimate goal. Thanks Anudeep a lot!!!
Jenny reeceJenny reece
Salesforce Object Query Language (SOQL) Use the Salesforce Object Query Language (SOQL) to search your organization's Salesforce data for specific information. SOQL is similar to the SELECT statement in the widely used Structured Query Language (SQL) but is designed specifically for Salesforce data. FB Status (https://www.digitalkhabar.in/fb-status-in-hindi-english/) Gym Status in Hindi (https://www.digitalkhabar.in/gym-status-in-hindi/)

Bhai Status (https://www.digitalkhabar.in/bhai-status-in-hindi/)
Robert howard 5Robert howard 5
Spot on with this write-up, I truly think this website needs much more consideration. I’ll probably be again to read much more, thanks for that info.
https://newgawai.wordpress.com https://hijaber.webnode.com