Activity Forums Salesforce® Discussions How can I use soql query on sobject in community user in apex?

  • Himanshu

    Member
    July 29, 2016 at 1:28 PM

    Hi Pranav,

    If you have the sobject name in a string, e,g, 'sobjname', you can then query back the record via something like:

    String queryStr='select id from ' + sobjname;

    List<sobject> = Database.query(queryStr);

    Hope this helps you.

  • [adinserter block='9']
  • PRANAV

    Member
    July 29, 2016 at 2:03 PM

    Hi Himanshu,

    Thank you for your solution , but I am asking for soql query in test class where user is of community type.

    Please give some suggestion on it.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Skip to toolbar