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
Amit Visapurkar 5Amit Visapurkar 5 

Trigger for updating a text field when lookup field value changes

I have a lookup field in my object and a text field.

Whenever the value of the lookup field changes the text field should get updated and i am trying to write a trigger for the same.

Please help it's very urgent.
The trigger only apply for record ( or a set of records). So, I guess you have to browse the value for lookup field of that record and change the textfield value to corresponding. 
Btw, why don't you use Process Builder? Don't need to write any apex code for this, if the requirement is only ask for change the text field value when lookup field value change.
Ravi Dutt SharmaRavi Dutt Sharma
Make the text field as formula field if you are fetching value from lookup field.