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
ChubbyChubby 

how to pull specific object record value when there is no relationship

Hi All,

I have Opportunity object having a field called Control(text). Another object Control with fields Control(Number) and State(text). Both are not related to eachother. Now my requirement is when opportunity control is updated, i need to search that value in Control object and pull specific state value on  to opportunity. Please suggest how to achieve this.

Thanks.
learn1.3947400898749973E12learn1.3947400898749973E12
Use can Use SOSL 
KrishnaAvvaKrishnaAvva
Hi Chubby,

Write an on Update trigger on opporrtunity.
Make a list of controls from the opportunity (trigger.new)
Query the same list on the CONTROL object and insert into a map.
Use the map in the trigger.new for Loop and update the oppportunity.

Regards,
Krishna Avva