?
Solved

CRM 4.0 Restrict Lookups to Account

Posted on 2010-11-19
9
Medium Priority
?
1,227 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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 2000 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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

Let’s face it: one of the reasons your organization chose a SaaS solution (whether Microsoft Dynamics 365, Netsuite or SAP) is that it is subscription-based. The upkeep is done. Or so you think.
If you're a modern-day technology professional, you may be wondering if certifications are really necessary. They are. Here's why.
Viewers will learn how to use the Hootsuite Dashboard.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

752 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