Activity Forums Salesforce® Discussions Can I use Map in dynamic query in Apex?

  • Suyash

    Member
    April 30, 2016 at 5:46 pm

    Hi Himanshu,

    No you cant use Map methods directly in Dynamic query.You need to first create a list/set to collect all the values or keys from the map and then you can use this list/set in your dynamic query.

    Thanks

  • Ajay Prakash

    Member
    February 18, 2018 at 6:45 am

    You can not use a map in a dynamic query because you can only use variables and collections in the dynamic query. map.Keyset() and map.Values() are the methods that you can not use directly inside a dynamic query.

     

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos