My opportunities are linked one to one with contacts. Is there a way when I am doing a contact lookup to just use the contact's email address instead of their name? This is a much more personally identifiable string than the name, especially if we have 6 John Smiths.
[SalesForce] Use email address in contact lookup search
Related Solutions
You could create an external ID text field on the Contact object that could be referenced from the Purchases load file (e.g., concatenation of some fields) and then perform an upsert of Purchases, specifying to use the new field to match on the Contacts.
When using the Data Loader Step 2b will be to choose your related Objects. At this point you will have the ability to select the External ID field for the Contact__r (or whatever your lookup to Contact field is named). In the mapping step, make sure that the external ID field is selected as well (e.g., Contact__r.External_ID__c).
To keep the external ID populated on the Contact, you could create a workflow rule that copies the FirstName and LastName (or whatever fields work in your situation) to an external ID field that you create, but don't add it to any page layouts. There'd be an initial update to all existing Contacts you'd have to do to get their external ID set.
If you go this route, just watch out for duplicates. If possible, it would be a good idea to try to select a combination of fields on the Contact that are also available on the Purchases that you could guarantee would always be unique and make the Contact external ID field unique.
To create the external Id field on the Contact, just create a new custom Text field on the Contact and check the External ID checkbox on it while creating it. There's a checkbox called External ID with a description of "Set this field as the unique record identifier from an external system".
Create a Workflow rule on the Contact that fires when at least on of the fields you are interested in changes (see ISCHANGED function). For example,
ISCHANGED(FirstName) || ISCHANGED(LastName)
Create a Workflow field update that has a target field of the new external ID field. Set its formula to be the value of FirstName + LastName (or whatever fields you use). For example, formula value of
FirstName + LastName
.Make sure to activate the Workflow rule.
It would be a good idea to test out whatever you are doing in a sandbox first, of course.
There is a nice tutorial that explains how to hack the URL here.
Step 3 – Pre-populating lookup values
You may have noticed that if you are following a similar example to mine, your lookup value will not be pre-populating like the default “New” button does. This is because behind that new button, Salesforce is bringing over the value from the previous object, as our button is fresh, we will need to do this ourselves (and with any other lookup values we have). They do differ slightly from basic text values which I will explain below.
To populate a Lookup value we need the field ID as before but this time we need to add CF to the front of the ID so it looks something like this – CF00Ni000000EpsgO. This is required when populating a custom lookup field. The first part to populate a lookup value is to grab the name of the record we are populating. So using the method before but with the added CF you can expect your button URL to look like this
`/a0U/e?CF00Ni000000EpsgO={!Opportunity.Name}`
The next step is to grab the ID of the record we wish to populate. This time though, we are going to add “_lkid” to the end of our field ID (plus the CF we added on earlier). This lkid parameter is telling Salesforce this is a lookup field. So it looks a bit like this.
/a0U/e?CF00Ni000000EpsgO={!Opportunity.Name}&CF00Ni000000EpsgO_lkid={!Opportunity.Id}
Again nothing too fancy we’ve just added some extra parts to the ID and referenced this field twice, grabbing the ID and the Name of the record. Please note the “&” used to separate the URL when referencing different fields. You can also see this being used below where I have the full URL used for this demonstration.
/a0U/e?CF00Ni000000EpsgO={!Opportunity.Name}&CF00Ni000000EpsgO_lkid={!Opportunity.Id}&00Ni000000EpsgY={!Opportunity.Description}
Your URL with notes
/a0H/e?CF00ND0000005Mxeb={!Contact.Name}&CF00ND0000005Mxeb_Ikid=**(DUPLICATE PARAMATER AND MISSING MERGEFIELD)**CF00ND0000005Mxeb_I(SHOULD BE l not I)kid={!Contact.Id}&CF00ND0000005MxeW={!Account.Name}(MISSING ID FIELD)&retURL={!Contact.Id}
Updated URL
/a0H/e?CF00ND0000005Mxeb={!Contact.Name}&CF00ND0000005Mxeb_lkid={!Contact.Id}&CF00ND0000005MxeW={!Account.Name}&CF00ND0000005MxeW_lkid={!Account.Id}&retURL={!Contact.Id}
Best Answer
If I understand the question correctly, you can add the contact.email field to the "Search Layouts" for the Contact sObject.
Go to Setup->Customize->Contacts->Search Layouts Click "Edit" on the Lookup Dialogs row, and add the email field. What the heck, just add the email field on all the Search Layouts!
What your users will see now is both the Contact Name and the Email... both searchable.