Lookup Issue (V 3.0 CRM)

Hello, 

On my Opportunity Form, I have a look-up field called "customerid". 

I need to write some JavScript code that when the user 
selects a customer (account) from the customerid 
field lookup, the custom field CFScompanyname is automatically fills
in. How do I get the company name from the above LookUp

Does anyone have an idea on how I would go about doing this? 

Thanks 


0
Utf
7/31/2007 5:00:02 PM
crm 35858 articles. 1 followers. Follow

2 Replies
746 Views

Similar Articles

[PageSpeed] 23

In the onChange event of the customerid field, put a javascript like:

var custName=crmForm.all.customerid.DataValue[0].name;
{
crmForm.CFScompanyname.value=custName;
}


-- 
Matt Wittemann, CRM MVP
http://icu-mscrm.blogspot.com


"kathyc" wrote:

> Hello, 
> 
> On my Opportunity Form, I have a look-up field called "customerid". 
> 
> I need to write some JavScript code that when the user 
> selects a customer (account) from the customerid 
> field lookup, the custom field CFScompanyname is automatically fills
> in. How do I get the company name from the above LookUp
> 
> Does anyone have an idea on how I would go about doing this? 
> 
> Thanks 
> 
> 
0
Utf
7/31/2007 9:28:01 PM
Another way is to access the data directly from the CRM database. Have a look 
at this 

var connection = new ActiveXObject("ADODB.Connection");
var connectionString = 
"Provider=SQLOLEDB;Server=MPWEB;Database=mp_mscrm;Integrated Security=sspi";
connection.Open(connectionString);
var name = crmForm.all.new_customernameid.DataValue[0].name;
var query = "select accountidname, accountid from dbo.FilteredContact C 
where C.fullname = '" + name + "'";
var rs = new ActiveXObject("ADODB.Recordset");
rs.Open(query, connection, /*adOpenKeyset*/1, /*adLockPessimistic*/2);
rs.moveFirst();

var list = new Array();
list[0] =  new LookupControlItem(rs.Fields(1).Value, 1,rs.Fields(0).Value);
  
crmForm.all.new_companyid.DataValue = list;
connection.Close();

Include this on your on change event of the lookup field
0
Utf
8/1/2007 6:00:01 AM
Reply:

Similar Artilces:

Microsoft Virtual PC 2007 and CRM 4.0 (Cont'd)
Dear Forum Members: I have installed Microsoft Virtual PC 2007 on my laptop and have the following files stored on my external Hard Drive: * MSDYCRM40VPC_BASE.part01 (executable file) * MSDYCRM40VPC_BASE.part02.rar * MSDYCRM40VPC_BASE.part03.rar * MSDYCRM40VPC_BASE.part04.rar * MSDYCRM40VPC_BASE.part05.rar * MSDYCRM40VPC_BASE.part06.rar Question(s): Should I copy (or cut) the MSDYCRM40VPC_BASE.part01 executable from my external device, place the file in a directory on my laptop, then RUN it? I need instructions on how to get up and running on my CRM 4.0 VPC image. Please help! Thanks, ...

Overlaying charts #3
I am looking for basic directions on overlaying charts in excel vsn 2003. I am trying to find a trend within sets of variables. In general it's more reliable to add the data to a single chart. Otherwise it's an ongoing struggle to keep chart elements lined up satisfactorily. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ cg wrote: > I am looking for basic directions on overlaying charts in excel vsn 2003. I > am trying to find a trend within sets of variables. ...

How to budget for abnormal expense? #3
I don't use Money's budgeting feature. Instead, I run two reports named Needs and Wants. I have a good idea of what those monthly totals should always be and I stay pretty close to them. When I have expenses that break the monthly budget, such as income tax return services, car repair, or something I know will occur during that time period, how do I make it part of the budget when it skews the monthly reports? I would categorize these services in my report as a Need. If that report's totals are usually around $2000/mo and I have 2 or 3 months through out the year that the tota...

Outlook 2002 v 2007 Send Receive speed
My desktop pc has an AMD x3 435 processor (2.9Mhz) and office 2007 including Outlook 2007. I have two POP3 email accounts and when I do a Send Receive (with no out going or in coming emails) it takes about 10 seconds (with no errors) to complete. I have just purchased a small note book with a 1.6Mhz Intel processor, it has WinXP and Office XP with Outlook 2002. I have set up Outlook with the same two POP3 email accounts in exactly the same way, but when I do a Send Receive it only takes a second or two! I know this sounds a bit pedantic but I would like to understand why there sho...

own CRM Professional, but CRM SBS installs on my SBS
Hi, I own the CRM Professional, as I also run Great Plains & intend on using the Integration when & if it releases. My issue is that when installing CRM on my Small Business Server, it installs CRM Small Business Edition. Will this be a problem when the Integration comes out? If so, is there a special way to install CRM Professional? I thought I'd post this instead of calling Microsoft, b/c I'm sure other customers will be having this problem & thought they'd like to know as well. Thanks. ...

CRM 4 Calendar error Event journaling invalid recipient
We have just upgraded to CRM 4 (from 3). In the web version of CRM, some of my calendar views display the error 'event journalling - invalid recipient type'. After experiementing, I have found that this happens on specific days. If I switch to view by month or week, they also fail if the range contains the day with the error. Otherwise everything works fine. I cant find any other view (eg. activity) or report that shows an event for the problem day. The server application event log contains the following type of event; Event Type: Warning Event Source: ASP.NET 2.0.50727.0 Event...

Direct Link to CRM Case in Email Template
All, Is there any way to give a direct link to CRM Case in Email Template. looking forward to hearing from you all asap. Regards, SAB. ...

RPC over HTTP Connection issue
I am trying to setup RPC over HTTP on my exchange 2k3 SP2 on a windows 2k3 server. I followed the list of directions and installed a certificate. I have a pix firewall and I am able to connect inside the firewall. When i try to connect from outside the firewall i notice in the connection status in outlook that it is trying to connect to the netbios name instead of the fqdn. I am not sure why that is. Check your Outlook configuration. Is the proxy configuration correct? Nue "Derrick" <Derrick@discussions.microsoft.com> wrote in message news:E6B0A9E8-39E1-4B4A-B346-4...

Opening Lookup Table
This is a multi-part message in MIME format. ------=_NextPart_000_000A_01CA9377.BBBDA640 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Access 2007 sp2 When I open a lookup table directly form my backend db the records have = the "+"=20 allowing me to expand and show the records associated with that = particular lookup record. (Movie genre in this case) But, when I open the linked table in my front end db the "+" signs = aren't there. Is there a way have the same thing occur (see records associated w...

CRM 4.0
We just upgraded to CRM 4.0 and I no longer see the search tab to search KB articles. Has this been done away with? How do I get it back? Thanks, -Rick M. Never mind - I found it - DUH! No longer a tab but in the picklist options. -Rick M. "Rick M" wrote: > We just upgraded to CRM 4.0 and I no longer see the search tab to search KB > articles. Has this been done away with? How do I get it back? > > Thanks, > -Rick M. ...

Upgrading CDF Database's from 1.0 to 1.2
Hey All, I need to know how to upgrade the CDF database's in the Microsoft CRM from Ver 1.0 to Ver 1.2 in order to use the Data Migration Tool. Microsoft Provided a link with the Data Migration tool, but that link is not longer functioning. If anyone has information regarding this, please let me know. Rgds Jefferson As far as I know, there is no "upgrade" for the CDF. v1.2 comes with a new version of the DMF that will install the correct version of the CDF for you. -- Matt Parks MVP - Microsoft CRM "Jefferson" <originaljeffie@hotmail.com> wrote in messa...

integrate web page form with sql and crm
Is it possible to edit the "case" form using front Page. If so how do i set it up to access the sql database. These forms are not designed to be edited in frontpage. "Dana" <anonymous@discussions.microsoft.com> wrote in message news:e28701c3f0e5$21e37e40$a101280a@phx.gbl... > Is it possible to edit the "case" form using front Page. > If so how do i set it up to access the sql database. ...

About the VIEW of CRM 3.0
How to change the settings of "Leads of Marketing Members" I want to add some fields into the VIEW of "Marketing Members(Leads)", but I didn't find it. It just display the Name of Lead, but it has no Names of Company. You might find this helpfull: http://yourcrmserver/tools/vieweditor/viewManager.aspx?id={2F0D0EDE-D356-4B1E-83BD-E978F10E3EEB} You will have to publish your customizations of course. But you´ll not find the Entity Marketinglist. It´s because these views are special so you´ll have to modify more than one view. You´ll find three V...

VBScript that dumps KB articles to HTML files
'This script creates an HTML file for each article in a Microsoft CRM Knowledge Base 'Created by Tony Hinkle, tonyhinkle@yxaxhxoxox.com 'You must modify the strOutputDir, strCRMServer, intStartId, intEndId constants for it to function properly 'strOutputDir is the directory where the HTML files will be created '********* ALL FILES IN THIS DIRECTORY WILL BE DELETED ********* Const strOutputDir = "G:\KB\" 'strCRMServer is the fully qualified domain name of your CRM server Const strCRMServer = "crm.yourcompany.com" 'intStartId is the lowest art...

Report type
Hi, How do I publish report in .pdf file format. Database - sql 2000 GP - 7.5 Business Portal -2.0 documentation that comes with GP specify that If I have acobat(not reader) install on report publishing workstation I should be able to publish report ..pdf however in GP, Report Scheduler Setup - Export File Type. I only have option of Text file, Tab - delimited, Comma - delimited and HTML file. Once I post the report and view it on Business Portal. The report is not in format, even though all dates are there. Please advise. Thanks, Jay ...

Reconciliation Report #3
I am anxious about switching from Quicken to Money 2003 (or 2004); however, I need one crucial report before I can do this. I've tried the 60 day trial of Money but I cannot find a reconciliation report. You see, after Quicken 2002 and above reconcile, they offer a complete report of all reconciled data and unreconciled data after (plus summaries). Is there a way to generate something like this in Money? Thank you, Roberto S. Matthews 5911 Forest Isle Dr. Apt 278 New Orleans, LA 70131 504-259-2934 rsmatth@hotmail.com In microsoft.public.money, Roberto S. Matthews wrote: >...

CRM 4
Via the crm 4 workflows it appears we can create almost anytype of entity, except additional addresses? is this a bug? I wanted to create a simple workflwo that is executed at the account and copies the account's address into a new secondary address. Thanks!! ...

Missing emails #3
I accidentally cut the power to my computer today and when I restarted, all emails before last August are there and all new emails since the power failure are there, but all messages in between are gone. I am viewing all messages, have tried dbxtract, have tried importing from various files and opening .pst's and .dbx's, but I can't seem to find those messages. They weren't deleted and all of the messages between those dates in all folders are gone. Can somebody please help? Thank you in advance. ...

How to add a Lookup Field
MS CRM does of it own have fields of type "Lookup" Can you add Lookup-fields to the schema and use it in customized forms? Thanks Frank Rombaut :-( Not in this version. Stephen "Frank" <f.rombaut@citee.nl> wrote in message news:%23rz$mdmlEHA.592@TK2MSFTNGP11.phx.gbl... > MS CRM does of it own have fields of type "Lookup" Can you add > Lookup-fields to the schema and use it in customized forms? > > > Thanks > Frank Rombaut > > > > Hi Stephan, Thank you for your response. MS CRM just dropped a few points in my ...

CRM 3.0 Professional for Action Pack Subscribers
Dear All, Further to previous threads where MAPS subscribers were complaining that Microsoft had only supplied the SB Version of CRM 3.0, leaving those who had installed 1.2 Professional out in the cold for an upgrade path: After much emailing to Microsoft I was put in touch with the right person to speak to and he told me that Microsoft were going to address the issue. I wasn't going top hold my breath on this one but they've actually come good on their word and this morning I was given an installation key for a 10 user version of CRM 3.0 Pro. Apparently you can use the media ...

issue refreshing data from microsoft query from within Excel
the error is: The Microsoft Office Access databaseengine cannot open or write to the file (blah, blah, blah)....It's already opened exclusively by another user, or you..... Help? ...

cleaning dirty fields in CRM 3.0
How can you programatically make dirty fields in CRM clean again? I have written a Microsoft Behavior control that can be added to a CRM field to make it act like a mask edit control. The problem is that this control is added dynamically to the CRM screen through its onload event. When the control is loaded, it automatically formats any data it finds in the field. To CRM, this looks like a field update which marks the field as "dirty". The problem now is that if you click the print icon on the screen, CRM responds with a message that the screen must be first saved before it can ...

Stuck Email #3
I'm running Outlook 2003 and I'm getting this error message when checking emails. Task '(Server Name) - Receiving' reported error (0x800CCC0F) : 'The connection to the server was interrupted. If this problem continues, contact your server administrator or Internet service provider (ISP). The server responded: +OK 641 octets follow.' I've been told by my ISP that it's a stuck email, a conflict between my email client and anti virus software. (Have just upgraded to Symantec SystemWorks 2004) If I log onto mailbox via web I can isolate the email to...

criteria issue
Hello, i like to add more fields as a criteria to the strWhere...........i like to [RequiredDate], [ID], and other fields...can anyone help with this. i am stuck with this. thanks..... lngLen = Len(strWhere) - 1 If lngLen > 0 Then strWhere = "[OrderNo] IN (" & Left$(strWhere, lngLen) & ")" lngLen = Len(strDescrip) - 4 If lngLen > 0 Then strDescrip = "Desc" & Left$(strDescrip, lngLen) End If End If -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-...

Find & Replace #3
I need to find empty cells and replace with 0. I thought I used to use "" to determine an empty cell or maybe I've just gone brain dead. Thanks Hi Nolan! Select the range Edit > GoTo > Special Check Blanks OK Type 0 then use Ctrl + Enter But this will only cover cells that are blanks and will not affect cells where formulas resolve to "". -- Regards Norman Harker MVP (Excel) Sydney, Australia njharker@optusnet.com.au Excel and Word Function Lists (Classifications, Syntax and Arguments) available free to good homes. Did you really type in the double quote...