We have a LWC,mycomponent
that will fetch custom metadata records, myCustomMetadataList and store them into a List variable within mycomponent
. When a user clicks on the Save button on this component, the component will update a Contact record with the data from the input fields on the LWC. There is an after update trigger that calls MyTriggerHandler.myMethod(newContactList, oldContactList)
. Within the myMethod()
, the same custom metadata record list, myCustomMetadataList
is needed to do additional processing. The way the process works
Questions:
- Can we pass
myCustomMetadataList
that was fetched from the LWC into the trigger such thatmyMethod()
can access the samemyCustomMetadataList
variable from the LWC without making a custom metdata query again? - How can we read the
myCustomMetadataList
variable in themyMethod
? - In
myMethod
if I wanted to get themyCustomMetadata
values, would I have to query again?