Solved

CRM 4.0 Restrict Lookups to Account

Posted on 2010-11-19
9
1,215 Views
Last Modified: 2013-12-12
When I create an order and click the Customer lookup, I want only Accounts to appear as an option. I have tried the script below but it messes up the Search function of the Customer lookup.  Is there a way I can change the script or another way to restrict the Customer lookup under Order to Accounts only?

The script below is the Onload Event of the Order entity.

Thanks
crmForm.customerid.lookuptypes = 1;

Open in new window

0
Comment
Question by:apollo7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 5

Expert Comment

by:HighlanderX
ID: 34176425
What is it doing to the Search function?

Maybe nothing, but the previous code i've seen has used .all


crmForm.all.customerid.lookuptypes=1;

Open in new window

0
 
LVL 1

Author Comment

by:apollo7
ID: 34176469
Here is what happens:

If I type a customer number in the lookup field, it does not work - gives me an error

If I then search, I can find it but when it comes back, the customerid is not recognized

I will try the script above, may just be the missing "all"

Thanks
0
 
LVL 1

Author Comment

by:apollo7
ID: 34176536
Tried the script with "all" included - same result.

The error message I get when I type in the customer number is: "error when trying to resolve the typed in address. Try using the Seach function"

After typing in, however, the Search function then does not work (brings back the customer id but only partially populates the customer id field)

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:mshogren
ID: 34199891
Try something like the following:

var customer = crmForm.all.customerid;
customer.lookuptypes = "1";
customer.lookuptypenames = "contact:1";
customer.lookuptypeIcons = "/_imgs/ico_16_1.gif";
customer.defaulttype = "1";
0
 
LVL 10

Expert Comment

by:Jeff Wight
ID: 34199912
Try this instead:

crmForm.all.customerid.setAttribute("lookuptypes", "1");
0
 
LVL 15

Accepted Solution

by:
mshogren earned 500 total points
ID: 34199989
Sorry mine should have read

Try something like the following:

var customer = crmForm.all.customerid;
customer.lookuptypes = "1";
customer.lookuptypenames = "account:1";
customer.lookuptypeIcons = "/_imgs/ico_16_1.gif";
customer.defaulttype = "1";
0
 
LVL 1

Author Closing Comment

by:apollo7
ID: 34200741
Thanks, worked perfectly first time.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
Video by: Tony
This video teaches viewers how to export a project from Adobe Premiere Pro and the various file types involved.
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question