You need to sign in to do that
Don't have an account?

Can anyone explain these parameters?
javascript: openLookup('/_ui/common/data/LookupPage?lknm=CF00N30000001BYw0&lkfm=editPage&lktp=' + document.getElementById('CF00N30000001BYw0_lktp').value,670,document.getElementById('CF00N30000001BYw0_mod').value,'&lksrch=' + escapeUTF(document.getElementById('CF00N30000001BYw0').value),'maxw')
lknm -- looks like a custom field id ( input element in the document.element... )
lkfm=editPage name of the form ( document.editPage)
ktp == type of the object to view in the lookup list ( three char prefix)
lksrch == search string to put into the lookup input box
all of these are input / ouput params to the common/data/LookupPage servlet
they work to enable a popup, lookup box. One of those params is where the lookup box should put the chosen object, which one?
well without looking at the source for openLookup() , i'd guess it's the form name + lknm
To get to the bottom of this , look at the source for openLookup(), it's in one of the javascript files included in the page this code came from.
Are these prefix reliable? Is it safe for me to use the openLookup function?
yes you can use openLookup() , I do in several of the S-Controls on the AppExchange.
try this in an scontrol
you need a form called "editPage", the final account ID ( after user picks one) is left in tsk3_lkid
you can remove the I ignore the other paramaters (some of which I don't understand)
Code:
Thanks for your time.
Guys,
Hoping you might be able to help, as this post is the closest thing I've found to what I'm trying to do.
I'd like to build a custom page for our opportunity capture, where I present the sales user with a simplified page with the mandatory fields required for the product they are selling.
As part of this, I will need multiple lookups to allow them to complete the record correctly. For example, one of these lookups may be to the account, one may be to the opportunity contact of a certain type. I may also need repeating lookups for each of the product line items on the opportunity.
Im trying to understand the best way to incorporate a lookup field in my page. As my lookups are across multiple objects, I'm using a custom controller instead of an extension. In this I am querying all of the data I need and referencing the fields directly:
<apex:inputField value="{!opportunity.AccountId}" />
<apex:repeat value="{!lineItems}" var="item" >
<apex:inputField value="{!item.Site__c}" />
etc
The problem with this method is how to update the fields when the user saves the form, as they are not bound to a variable in the controller?
So I'm thinking I need to do something a little more custom and use the openLookup function for each of my required lookups, and then pass the selected IDs to the controller using hidden parameters.
You mentioned that the selected ID from the lookup gets set into the 'tsk3_lkid' field. How would I do something similar with multiple lookups?
Hopefully I'm making sense and you can point me in the right direction.
All the best,
Andrew