You need to sign in to do that
Don't have an account?

How to use Map on Apex using multiple key to update a field
Hi All
Can you help me to explain about MAP on apex trigger , i have 2 object and i want to get value on the other object base on multiple key on the object. please find bellow :
i want to get CPD ID and add into contract product delivery base on Key (Prospect, Prospect_Product, Sub Item, SAP ID)

Thanks
Singgih Juniawan
Can you help me to explain about MAP on apex trigger , i have 2 object and i want to get value on the other object base on multiple key on the object. please find bellow :
i want to get CPD ID and add into contract product delivery base on Key (Prospect, Prospect_Product, Sub Item, SAP ID)
Thanks
Singgih Juniawan
You create a string that concatenates all the pieces you need and use that as your key in your map, with the value being the CPD Id. Then you build that key again while looping through your Prospect Product Details and get the value from your map.
The code below will not compile, but it should give you an idea as to how to attack this problem.