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

Trigger Guidance: How to create multiple records triggered from a selection in picklist?

Use case:  
(multiple custom objects, 1 record triggers multiple records in other custom object)


- Custom Object A contains multi-select picklist with values apple, orange , grape, & banana 

- User creates record in object A and makes selections apple, orange from picklist

- Trigger: Creates two records in Custom Object B based on the selections of apple & orange  

- Apple & Orange are differnt record types in Custom Object B


I'm new to triggers and here's my questions:


1. Is this a difficult trigger?

2. Should I be looking to use triggers for this use case in the first place?


All guidance and feedback is welcome - thanks.  




You will have to create a insert/update/delete trigger on object A - recommended AFTER trigger. This will simply insert,update or delete the records in object B based on the update operation of the multi-select picklist.


This should not be difficult at all. If you are new to Apex trigger, I would suggest you to start with simple operation which will insert into object B based on the selection in object A. And then extend it to other operations to delete or update.


You will need to store the key of object A into object B. Which you could use for updates or deletes..  


If you have any challenges or more questions, post here..