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
Benjamin Zerbib 3Benjamin Zerbib 3 

Update Field through Trigger

Hello everybody!
I have a custom object (Signoff) connected to Opportunity through a Master-Detail relationship.
On Signoff, there is a field called Currency. I would like to make sure that if the Currency field on Opportunity is 'US Dollar' for example, the Currency field on Signoff must be automatically updated to 'US Dollar'.

I tried to make it through a Workflow but I can't update the Currency field on Signoff with a Workflow.

How to do it with code, please?

Thanks a lot
Benji
Arvind_SinghArvind_Singh
Benji, 

You can do it by workflow/process builder. I assume you have Multiple Currencies activated in your org. you can use ISPICKVAL( CurrencyIsoCode,"USD")  in workflow/process builder  formula as condition. It will evaluate if entered currency entered in USD or other.  For field update, Use Formula to update something like text('US Dollar').