Tech Support > Microsoft Windows > Windows CRM > Second Account Lookup field in Order Form
Second Account Lookup field in Order Form
Posted by Raj Limaye on September 13th, 2006


We keep our Order records in CRM. The Order has Parent Customer field which
is the end user. Howeer, lot of our orders are throuh an Agent. All our
agents also exist in CRM as Account entities.
I want to add a custom field called "Agent" that will lookup the records in
Account database.
I don't want to create Agent as new entity as it will have to be maintained
seperately.
For Opportunities, this problem does not arise as I can add related records
of type Account with a relationship role of agent. However, for Opportunity,
relationship role is also not allowed.
Is there any way to add a second lookup field "Agent" that provides lookup
to Account entity?
--
Raj Limaye, PMP

Posted by Darren Liu on September 13th, 2006


Hi Raj,

Easily to add a second account lookup field? "No"

Able to add a secondary account lookup field? "Yes"

what you can do is to add two text fields, one storing the name of the
account and second storing the GUID of the account. on the form onLoad
event, write some javascript to hide one of the text fields and find
the code for another text field, then you remove the html for that text
field and inject some html to make a lookup field.

After you done so, at the form OnSave event, grab the value of the
lookup field and parse it so it stores the account GUID to the GUID
text field and account name to account name field.

on the OnLoad of the event, you have to also check to see if those two
fields are populated, if so you need to inject the html to populate the
secondary account lookup.

this is one of the support ways to do it. I have done it myself for my
clients. I hope this helps!

Darren Liu
Crowe Chizek and Company
http://www.crowechizek.com/crowe/microsoft


Raj Limaye wrote: