function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

How to create child based on multi pick list value selection.

Hi All

How can i create child based on multi picklist value selectio on parent.I will select 1 value in multi picklist then it will create 1 child .i will select 2 value then it will create 2 child and so on.

Niraj Kr SinghNiraj Kr Singh

I am considering following details to meet ur requirements:
Parent Object: Account
Parent Object Multiselect Picklist : TestMultiselect__c
Child object: Contact

Write trigger on Account :
trigger CreateChilds on Account(after insert, after update) {
	List<Contact> newContactList = new List<Contact>();
	if(trigger.isAfter && (trigger.isInsert || trigger.isUpdate)) {
		for(Account objAcc: {
			if(objAcc.TestMultiselect__c != null) {
				for(String strEachValue : objAcc.TestMultiselect__c.split(';')) {
					newContactList .add(new Contact(FirstName='Test', LastName='Test')); //add all required fields here.
		insert newContactList;

Note: Might be some update needed according to ur requiremnets.