• #65925
    Salesforce | Nikita Nikita #2
    Forcetalks

    How to get know the OwnerType of a case is Queue in apex?

    How to get know the OwnerType of a case is Queue in apex?

    #65955
    Salesforce | Yogesh Yogesh #6
    Forcetalks

    Hello,

    you can check

    if(string.valueOf(c.OwnerId).startsWith(‘005′))
    {
    //owner is User
    }

    if(string.valueOf(c.OwnerId).startsWith(’00G’))
    {
    //owner is Queue
    }

    This can save you a SOQL 🙂 and is standard across all ORGS in salesforce

    if our suggestion(s) worked, let us know by marking the answer as “Best Answer” right under the comment.This will help the rest of the community should they have a similar issue in the future.

    Thank you!

    #66020
    Salesforce | Deepak Deepak #4
    Forcetalks

    Query the case owner as it is a user then query usertype of that user.

Viewing 3 posts - 1 through 3 (of 3 total)

Please to reply to this topic.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2019 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?