0

I am developing app to grab a certain set of data from salesforce and sending it to an external system. I want to do this in a customizable way so that each installation can choose its own mapping. For example, one input field for the api is email, and it may map to lead.email, contact.email, or some other custom field.

My current idea is to create an custom settings object, with values pointing to the mapped fields. Then in my apex code, I would some how look up the value for each by the mapped field name.

This my idea feasible? Is there a better way to approach this?

enter image description here

1 Answer 1

1

This sounds like a viable idea, as long as you know which field entry in the setting maps to the other end. Of course, if you want to be able to support a scenario where new fiields could be added to the remote system than rather using the field name of the setting record you could use a list-type setting, use the name field to hold the name of the remote field and then add a new text field to store the local field name (and maybe object name if needed).

Any code could just run over the list of entries in the setting and work out the mapping accordingly.

You must log in to answer this question.

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