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
sumit pawarsumit pawar 

how to get value of one field to another field?

here a small requirement i having..

i having contacts.. and default description field in contact object...
now i created another description1 textarea field in contact object..

i want to copy automatically everytime contents of description field in description1 field.

what i do Please suggest?
PrasanntaPrasannta (Salesforce Developers) 
Hi,

Write a trigger on object which has "Before Insert,Before update"  event

For example you want to copy one field's value to other field's value on Account object, refer the below trigger-

trigger CopyFieldsonAccount on Account (before insert, before update) {
    for(Account account : trigger.new) {
     //Field that you want to be copied by other field keep those on left side
      account.Field1 = account.Field2;   
    }
}

Hope this helps.
Tejpal KumawatTejpal Kumawat
Hello Sumit,

You can do it simply using workflow rule: 
1. Create workflow : using Evaluation Criteria Evaluate the rule when a record is created, and every time it’s edited and Rule Criteria ISCHANGED( Description )

2. Create Field Update in Workflow Actions : using Field to Update Contact: description1 and Formula Value Description

If any queries, let to me. It works correctly.

Thanks
Tejpal

Rahul Arora 43Rahul Arora 43
how to get value of one field to another field?

 A standard field " Phone_c" and  custom field "mobile_c" and i want that the record from custom field copied to standard field i.e "Phone_c" how i can achieve that by using workflows and what formula i exactly need to put after selecting field update option.   ​