I have a custom object "Bodies of Water". My client wants to be able to create new opportunities directly from this object with two fields already populated (The body of water name itself, and the name of the account it's attached to). Both of these fields are lookups.

Currently, only the Body of Water name is populating properly, and I need to get the account one functioning as well.

I realize that the account name lookup field is a standard field on the opportunity object - how can I find the proper ID for this so that it will autopopulate?

This is the current code that I have. The second ID is not correct.


Any thoughts?


2 Answers 2


Once you are in the edit pavev, Use mouse right click to view page source and find the id from there. I have done it couple of times and it works like a magic.


Try this:


For each lookup field, you want to pass both the name and the id of the record, since only passing the name will cause you to have to select the correct one in case multiple records share the same name.

As mentioned in previous answer, you can get the field id by right-clicking and selecting Inspect Element.

You must log in to answer this question.

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