1

I have a standard Opportunity object with the appropriate standard and custom fields. Now I have been asked to create a custom object that will have its respective standard and custom fields populated with the Opportunity object and its fields.

How can I copy data/fields from the standard Opportunity object to the equivalent data/fields in my custom object?

1
  • Welcome to SFSE, Rup. You could definitely do this with triggers, but why would you? It would be a pain to maintain.
    – Mike Chale
    Commented Jul 1, 2013 at 23:06

1 Answer 1

2

As suggested by Mike you can write a trigger to copy the data from one object to another. However if you are looking for a more generic option then you could create a custom setting in ur org to define the field level mapping between opp and the custom object and then use a apex class or trigger to dynamically copy the record from opp object to ur custom object.

1
  • yeah maintaining the field mapping in a custom setting is a good solution as you wouldn't have to touch the trigger everytime a field needs to be mapped..
    – Sam
    Commented Aug 31, 2013 at 6:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .