Question

Salesforce - Can you filter Custom LOOK-UP fields based on the Account Type?

Asked by: sumprit

Hi there,

Please see the attached file which has the exact requirements. In order to explain my problem it is important to see the attached file, which has screen shots and the images?

Thanks

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2008-02-25 at 21:34:11ID23192616
Tags

Salesforce.com

Topic

CRM Software

Participating Experts
2
Points
500
Comments
14

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Screen shots
    Hi, I'm trying to paste a screen shot into an AppleWorks document, I've figured out to usge COmmand-Shift-4 to take the shot I want, but how do I paste that shot into my AppleWorks document? Thank you.
  2. Screen shot in unix
    In Windows, the [PrintScreen] key gets a screen shot (the current image on the screen). How do you do the same in Unix? I'd be interested especially in an answer which covers most flavours of Unix. Thanx.
  3. Screen Shot
    I was wondering how do I take a screen shot of a movie thats playing? Thank you for your time.

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

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?

 

by: sumpritPosted on 2008-02-26 at 12:48:41ID: 20988624

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?


 

by: Bill-HansonPosted on 2008-02-26 at 13:19:26ID: 20988961

First, you need to design a form that uses the Salesforce API to provide the lookup.  You'll need a text field for entering the query, a button for submitting the query, and a <div> that will hold the search results.

In your query button, you will use the api's "query" method to get a list of matching records.  Then, you will use these records to write the HTML that will be pushed into the <div>'s innerHTML property.  The html should include links that will close the pop-up and set the hidden fields in the main form.

 

by: sumpritPosted on 2008-02-26 at 14:35:07ID: 20989718

Thanks Bill. This sounds like a big project - and it is, my question is - if I start on this..would you be able to guide me through until I finish this. I understand EE does not allow to take this offline, so I post my queries here would you able to check in regurarly.

1.> To design a Form using the Salesforce API.
I am assuming this can be done using any HTML editor and then how will I determine which Salesforce API Name to be used.

I think I will stick to the first step for now and then move forward from here.

Thanks again

 

by: Bill-HansonPosted on 2008-02-27 at 06:13:23ID: 20994052

Sure, I've never built a custom picker for SFDC, but it's just a matter of time before I need one.  We can just keep adding to this question as we work on the solution.  I develop software full-time, so I won't always be able to answer immediately, but I won't leave you hanging around forever.  If I can't respond right away, I'll let you know.

I think that getting the popup to read records and return values to the proper hidden fields will be the easy part.  Our first challenge is to get the button on the form to show our popup instead of the SFDC one.

One way we can do that is to remove the account reference field and add our own field along with a custom button.  I'm not crazy about this solution because it may affect reporting.

Another way is to include some script that will force the existing button to call our code.  I will start looking for the best way to do this in my spare time.  Do you have a deadline?

 

by: sumpritPosted on 2008-02-27 at 13:19:43ID: 20998498

Hey thanks for replying again.
No I do not have a deadline for this issue yet, they have thrown this on me to see how far can I get with this issue. Pretty much testing my abilities !

I will start on this project starting next week. Is it anyway I can contact you outside EE like I can be reached on suma_anand04 on t messenger...Not sure if the EE community will allow to do that...

Also - I have another Salesforce related question related to Validation rules. Here is the link - can you help me with this:-

http://www.experts-exchange.com/Database/Software/CRM/Salesforce.com/Q_23192139.html

This is another SF questions have not got a reply to it yet.

 

by: Bill-HansonPosted on 2008-02-27 at 13:53:30ID: 20998839

Sorry, I don't run chat apps anymore -- too busy.  I'll see whenever you post to this thread, though.

About Validation rules -- sorry again.  I've never used them.

 

by: sumpritPosted on 2008-02-27 at 13:54:12ID: 20998849

hmm..ok thank you for your help.

 

by: sumpritPosted on 2008-02-27 at 13:55:12ID: 20998860

What about S-controls - I need advice on one S-control - do you think you can help me with that. I can post a different question for that one.

 

by: Bill-HansonPosted on 2008-02-27 at 14:18:14ID: 20999070

Sure, I've written plenty of those.  I just leave the built-in stuff like Validation Rules and Email Templates to the admin types.

 

by: sumpritPosted on 2008-02-27 at 14:26:46ID: 20999132

Excellent!

I just posted the question under Salesforce zone.
http://www.experts-exchange.com/Database/Software/CRM/Salesforce.com/Q_23198726.html

Let me what you think , looking forward to hear from you.

Thanks

 

by: Bill-HansonPosted on 2008-02-28 at 12:53:07ID: 21007919

Hey,

I was just staring to work on this when I realized that you can't run custom JavaScript when a page is in edit mode except via a custom button or link.

sControls don't even load in edit mode, so we can't use them.

The only option left is to add a custom button or link that would use our custom lookup rather than the default one.  The problem with this is that the users will have two buttons -- one right by the field (the standard one) and ours (probably at the top of the form).  How do we get the users to click the right button?  There's no way to enforce use of our control over the built-in one.

Salesforce has hinted for years that they will have form events that we can code like formPostOpen, formQuerySave, etc.  If they ever do implement these events, overriding the button should be easy.

I haven't completely given up yet, but I wanted to give you a heads up.

 

by: topherf17Posted on 2009-02-19 at 11:55:15ID: 23685437

Were you able to successfuly build a window that filters the results on a lookup?

 

by: Bill-HansonPosted on 2009-02-19 at 12:03:25ID: 23685523

Not yet.  Actually, I'm monitoring your current open question, but since I don't have any news, I didn't post anything.

Since SFDC has some new design elements, I plan to re-visit this issue soon.  I'm hopeful that VisualForce Pages may do what we need, but I haven't had time to test.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...