Skip to content

Querying from domain class #6

@sarava77

Description

@sarava77

Hi,

I am suggest how to write query for below scenario.

In Controller:
bookstoreCont.bookapply(new list<Bookstore__c> { bookstoreIns });

In Domain
public static void bookapply(list<Bookstore__c> bookstoreInsPraram)
{
list<Bookstore__c> bookStroeList=new list<Bookstore__c>();
//This is the place where i am facing problem.
bookStroeList=[select id,Name from Bookstore__c where Email__c=:bookstoreInsPraram.Email__c];
}

Because I can't query directly by using the list variable . so i need to convert to single instance and then I need to use in the where condition to query the record. Is there any other way to achieve this without creating one more variable.

Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions