I'm trying to query an entitlement process with a specific name to dynamically assign it to an account based on certain criteria. I can't seem to get the query correct. I googled around and the object is supposed to be EntitlementProcess but it doesn't seem to work.

My query looks like this:

EntitlementProcess sla =[Select id from EntitlementProcess Where Name='SLA Tracx'];

What am I doing wrong here?


Actual Object name to access from API is SlaProcess and in UI it is EntitlementProcess

SELECT Id, description, name From SlaProcess Where Name='SLA Tracx'

Ideally Account will linked with Entitlement and Entitlement is linked with SlaProcess (aka EntitlementProcess).

So your query to get AccountId based on Entitlement and SlaProcess will be:

SELECT AccountId, Name 
FROM Entitlement 
WHERE SlaProcessId IN (
    SELECT Id 
    From SlaProcess 
    Where Name='SLA Tracx')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.