Activity Forums Salesforce® Discussions How can we develop multi select datalist on the basis of different searches for different element searched for?

  • Parul

    Member
    September 20, 2018 at 1:05 am

    Hi,

    List<Account> accountList = new List<Account>();
    List<Contact> contactList = new List<Contact>();

    for (Integer i = 0; i < 10; i++) {
    accountList.add(new Account(Name = 'Boards Test Accout ' + i));
    contactList.add(new Contact(
    FirstName = 'Boards ' + i,
    LastName = 'Test Contact'
    ));
    }

    List<sObject> objects = new List<sObject>();
    objects.addAll((List<sObject>)(accountList));
    objects.addAll((List<sObject>)(contactList));

    insert objects;

  • shariq

    Member
    September 20, 2018 at 7:29 pm

    Hi,

    Parul could you explain your code.

    Thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos