Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Astute Commentator
Posts: 16
Registered: ‎04-15-2009

Store the accountid from a lookup instead of the Account Name.

Hi everyone.


I created a new form and I added a lookupEdit field that opens up an Account lookup.

I would like to search in the lookup based on the account name, but store the AccountID selected and not the name of the account.

As default it stores the the Account name (Since that is the field I'm doing a search on).


Any ideas?





Silver Super Contributor
Posts: 801
Registered: ‎03-24-2009

Re: Store the accountid from a lookup instead of the Account Name.

[ Edited ]

This is what it actually does by default?

Look at the Account lookup - you find the account by name, but it stores the ID, not the name. I think you have set the control incorrectly. It should be this:


1) Control.LookupID - bound to the column in DB. This would be the ID returned from the lookup e.g. AccountID

2) Control.Text - the textual version of the lookup e.g. Account (and any joins to get that data in here)


The lookup itself has a property called ID Field - this is what is returned from the lookup irrespective of what the user searched for. This is what would be populated into yourControl.LookupID (or should be).