0

I am creating a new text field for my contact object.

Once I create this new field, I'd like it's value to be pre populated with the value from another contact field, but only when I initially create the new field.

With any new contacts added, this field should not be populated.

Clearer Explanation:

Creating a new field under Contact called Organizationof type Text

When I create this field I want it to get it's default value from Account which is of data type Lookup(Account). So that for all existing entries, the Organization fields value will be the account name as text.

Is it possible to do this?

  • Just use Data loader for this task, or Anonymous Apex code – o-lexi Nov 16 '16 at 18:20
1

If you want this new field populated on existing records, you are going to have to dataload the value. Run a report for all of your existing contacts with the fields ContactID and Account Name. Export the report, change the column name from Account Name to Organization and save as a CSV. Go to Setup > Data Management > Data Import Wizard. Launch Wizard, choose Accounts and Contacts, Update existing records, upload your CSV, hit next, match your column (should automatically find the contact ID and new field label) and start the data load. All of your existing contact records should be updated within minutes.

  • Do you have any idea why nearly half my records would be failing to update? My research suggested this happens when mapping ids are incorrect but I just exported the data and re-imported right away. – Belgin Fish Dec 1 '16 at 16:59
  • You should have received an error email message with an attachment that gives you the error. Can you let me know what the error message is? – joe.stolz Dec 5 '16 at 16:42
1

Field update with workflow rules. It something like this.

enter image description here

enter image description here

  • But it needs to be dynamic based on the contacts assigned account name. – Belgin Fish Nov 16 '16 at 17:42
  • so, to do so, you should user the formula editor – ransommule Nov 16 '16 at 17:43
  • sorry, with formula editor i dont think it is possible,. – ransommule Nov 16 '16 at 17:46
  • you can create a workflow rule, to be fired only on record creation – ransommule Nov 16 '16 at 17:46
  • Would it be possible to give me an example to put me in the right direction? – Belgin Fish Nov 16 '16 at 17:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.