woww! Seems like lot of work than I possibly thought.
My javascript coding skills are beginner level - but I am able to put 2 and 2 together and get things working. :-) Maybe not be smart but it works, and at the side I keep working to improve on those.
To answer your first question - The MAKE object is the custom object that I created with a new record type and the page layouts.
Hmm..You really got me thinking there, Exacytly where should start this from?
Main Topics
Browse All Topics





by: Bill-HansonPosted on 2008-02-26 at 06:32:04ID: 20984557
As far as I know, you can't filter the built-in lookup window, but there's nothing stopping you from designing your own lookup window component.
You should start by taking a look at the source code for your Make object to see how Salesforce does it, then use that as a model for designing your own pop-up. You will probably want to use a tool like Firebug for Firefox for inspecting the form's elements.
You can design the pop-up window any way you like, but it will need to target the following fields on the Make form so that Salesforce can update its database properly when the Make record is saved:
Where XXX is the name of the Account field:
XXX - Editable text field that holds the current name of the Account.
XXX_lkid - Hidden field that holds the id of the record selected in the pop-up (default = "000000000000000").
XXX_lkold - Hidden field that holds the name of the record selected in the pop-up (default = [Same as XXX]).
XXX_mod - Indicates whether the field has been modified (values = "0" or "1", default = "0").
XXX_lktp - Hidden field used by the pop-up to indicate which type of record to display in the pop-up. This is not required unless you want to make your control more compatible with the built in control. For example, for Account, this would be set to "001".
XXX_lspf - Hidden field. I'm not sure what the purpose of this one is. The default value is "0" and it never seems to change.
For example, on the Opportunity page, the Account back-end fields might look like this when the form is placed in edit mode. There is an existing account selected with id of "0013000000C1jFt" and a name of "ACME Testing". The lookup window will display account records ("001"), and the field has not been modified (opp4_mod = "0").
<input id="opp4_lkid" type="hidden" value="0013000000C1jFt" name="opp4_lkid"/>
<input id="opp4_lkold" type="hidden" value="ACME Testing" name="opp4_lkold"/>
<input id="opp4_lktp" type="hidden" value="001" name="opp4_lktp"/>
<input id="opp4_lspf" type="hidden" value="0" name="opp4_lspf"/>
<input id="opp4_mod" type="hidden" value="0" name="opp4_mod"/>
After selecting a new account, the fields look like this:
<input id="opp4_lkid" type="hidden" value="0013000000FVDoQ" name="opp4_lkid"/>
<input id="opp4_lkold" type="hidden" value="TEST - Company A" name="opp4_lkold"/>
<input id="opp4_lktp" type="hidden" value="001" name="opp4_lktp"/>
<input id="opp4_lspf" type="hidden" value="0" name="opp4_lspf"/>
<input id="opp4_mod" type="hidden" value="1" name="opp4_mod"/>
When the user saves the record, Salesforce knows what to do based on the contents of these fields.
So, at a minimum, any custom lookup control should set these fields when a record is selected in the pop-up: XXX_lkid, XXX_lkold, and XXX_mod.
I realize that this is probably not exactly what you are looking for. How are your JavaScript coding skills?