OnSave function - Lookup values being truncated in Contacts

Hi all,
I am currently returning a value from the Parent Customer ID field in 
Contacts using OnSave . These values are being passed into a Web Service and 
onto another database.
Code below:

var lookupItem = new Array;
lookupItem = crmForm.all.parentcustomerid.DataValue;
if (lookupItem[0] != null)
{
var sAccountID = lookupItem[0].name;
}

The Problem I am getting is when I return a value from the lookup like "A & 
E Builder", the string is truncated and I am left with 'A'.
Does anyone no a workaround for this? I really need to return the full text 
value as it appears in CRM.
I suspect I need to change the "lookupItem[0].name" to something like 
lookupItem[0].name.selectedText...?

Cheers
Matt
0
Utf
3/3/2006 3:08:26 AM
crm 35858 articles. 1 followers. Follow

4 Replies
418 Views

Similar Articles

[PageSpeed] 37

Guessing it has to do with the "&" in the value.  Are you certain you aren't 
getting the full value and whatever method you are using to display it isn't 
truncating it?  The "&" is a special char in HTML, so if you are putting it 
on a page, it could be reneded as non-visible.

-- 

Matt Parks
MVP - Microsoft CRM


"Matt" <Matt@discussions.microsoft.com> wrote in message 
news:A7E06C1C-3EFB-4E04-911F-D1E38678BCF8@microsoft.com...
Hi all,
I am currently returning a value from the Parent Customer ID field in
Contacts using OnSave . These values are being passed into a Web Service and
onto another database.
Code below:

var lookupItem = new Array;
lookupItem = crmForm.all.parentcustomerid.DataValue;
if (lookupItem[0] != null)
{
var sAccountID = lookupItem[0].name;
}

The Problem I am getting is when I return a value from the lookup like "A &
E Builder", the string is truncated and I am left with 'A'.
Does anyone no a workaround for this? I really need to return the full text
value as it appears in CRM.
I suspect I need to change the "lookupItem[0].name" to something like
lookupItem[0].name.selectedText...?

Cheers
Matt 


0
Matt
3/3/2006 5:20:54 AM
Hi Matt
I agree, it is definitly the "&" value.
The way I found out the returned value was using SQL profiler to watch it 
being passed into my Stored Proc. I am not displaying it on a web page, just 
collecting it from CRM and passing it via a URI string into a vb.NET web 
service (and onto an external database). The Web Service is simply passing 
the values, there is no data manipulation occuring at that point.

I am reasonbly certain the truncating is taking place within the javascript
var sAccountID = lookupItem[0].name

I will do some further tests anyway see what more I can find. Any further 
help would be appreciated.

Thanks for your help, Cheers


"Matt Parks" wrote

> Guessing it has to do with the "&" in the value.  Are you certain you aren't 
> getting the full value and whatever method you are using to display it isn't 
> truncating it?  The "&" is a special char in HTML, so if you are putting it 
> on a page, it could be reneded as non-visible.
> 
> -- 
> 
> Matt Parks
> MVP - Microsoft CRM
> 
> 
> "Matt" <Matt@discussions.microsoft.com> wrote in message 
> news:A7E06C1C-3EFB-4E04-911F-D1E38678BCF8@microsoft.com...
> Hi all,
> I am currently returning a value from the Parent Customer ID field in
> Contacts using OnSave . These values are being passed into a Web Service and
> onto another database.
> Code below:
> 
> var lookupItem = new Array;
> lookupItem = crmForm.all.parentcustomerid.DataValue;
> if (lookupItem[0] != null)
> {
> var sAccountID = lookupItem[0].name;
> }
> 
> The Problem I am getting is when I return a value from the lookup like "A &
> E Builder", the string is truncated and I am left with 'A'.
> Does anyone no a workaround for this? I really need to return the full text
> value as it appears in CRM.
> I suspect I need to change the "lookupItem[0].name" to something like
> lookupItem[0].name.selectedText...?
> 
> Cheers
> Matt 
> 
> 
> 
0
Utf
3/5/2006 10:00:29 PM
The problem you have is you need to encode the value before submitting it 
via the URI.  This is a special character and is causing the problem.

-- 

Matt Parks
MVP - Microsoft CRM


"Matt" <Matt@discussions.microsoft.com> wrote in message 
news:1C04F437-AAB1-4E20-B397-A704EB9B92B0@microsoft.com...
Hi Matt
I agree, it is definitly the "&" value.
The way I found out the returned value was using SQL profiler to watch it
being passed into my Stored Proc. I am not displaying it on a web page, just
collecting it from CRM and passing it via a URI string into a vb.NET web
service (and onto an external database). The Web Service is simply passing
the values, there is no data manipulation occuring at that point.

I am reasonbly certain the truncating is taking place within the javascript
var sAccountID = lookupItem[0].name

I will do some further tests anyway see what more I can find. Any further
help would be appreciated.

Thanks for your help, Cheers


"Matt Parks" wrote

> Guessing it has to do with the "&" in the value.  Are you certain you 
> aren't
> getting the full value and whatever method you are using to display it 
> isn't
> truncating it?  The "&" is a special char in HTML, so if you are putting 
> it
> on a page, it could be reneded as non-visible.
>
> -- 
>
> Matt Parks
> MVP - Microsoft CRM
>
>
> "Matt" <Matt@discussions.microsoft.com> wrote in message
> news:A7E06C1C-3EFB-4E04-911F-D1E38678BCF8@microsoft.com...
> Hi all,
> I am currently returning a value from the Parent Customer ID field in
> Contacts using OnSave . These values are being passed into a Web Service 
> and
> onto another database.
> Code below:
>
> var lookupItem = new Array;
> lookupItem = crmForm.all.parentcustomerid.DataValue;
> if (lookupItem[0] != null)
> {
> var sAccountID = lookupItem[0].name;
> }
>
> The Problem I am getting is when I return a value from the lookup like "A 
> &
> E Builder", the string is truncated and I am left with 'A'.
> Does anyone no a workaround for this? I really need to return the full 
> text
> value as it appears in CRM.
> I suspect I need to change the "lookupItem[0].name" to something like
> lookupItem[0].name.selectedText...?
>
> Cheers
> Matt
>
>
> 


0
Matt
3/9/2006 4:38:36 AM
Gotcha, Thanks very much Matt.
I have read about the encoding and will add this to my Javascript.

Thanks again
Cheers
Matt

"Matt Parks" wrote:

> The problem you have is you need to encode the value before submitting it 
> via the URI.  This is a special character and is causing the problem.
> 
> -- 
> 
> Matt Parks
> MVP - Microsoft CRM
> 
> 
> "Matt" <Matt@discussions.microsoft.com> wrote in message 
> news:1C04F437-AAB1-4E20-B397-A704EB9B92B0@microsoft.com...
> Hi Matt
> I agree, it is definitly the "&" value.
> The way I found out the returned value was using SQL profiler to watch it
> being passed into my Stored Proc. I am not displaying it on a web page, just
> collecting it from CRM and passing it via a URI string into a vb.NET web
> service (and onto an external database). The Web Service is simply passing
> the values, there is no data manipulation occuring at that point.
> 
> I am reasonbly certain the truncating is taking place within the javascript
> var sAccountID = lookupItem[0].name
> 
> I will do some further tests anyway see what more I can find. Any further
> help would be appreciated.
> 
> Thanks for your help, Cheers
> 
> 
> "Matt Parks" wrote
> 
> > Guessing it has to do with the "&" in the value.  Are you certain you 
> > aren't
> > getting the full value and whatever method you are using to display it 
> > isn't
> > truncating it?  The "&" is a special char in HTML, so if you are putting 
> > it
> > on a page, it could be reneded as non-visible.
> >
> > -- 
> >
> > Matt Parks
> > MVP - Microsoft CRM
> >
> >
> > "Matt" <Matt@discussions.microsoft.com> wrote in message
> > news:A7E06C1C-3EFB-4E04-911F-D1E38678BCF8@microsoft.com...
> > Hi all,
> > I am currently returning a value from the Parent Customer ID field in
> > Contacts using OnSave . These values are being passed into a Web Service 
> > and
> > onto another database.
> > Code below:
> >
> > var lookupItem = new Array;
> > lookupItem = crmForm.all.parentcustomerid.DataValue;
> > if (lookupItem[0] != null)
> > {
> > var sAccountID = lookupItem[0].name;
> > }
> >
> > The Problem I am getting is when I return a value from the lookup like "A 
> > &
> > E Builder", the string is truncated and I am left with 'A'.
> > Does anyone no a workaround for this? I really need to return the full 
> > text
> > value as it appears in CRM.
> > I suspect I need to change the "lookupItem[0].name" to something like
> > lookupItem[0].name.selectedText...?
> >
> > Cheers
> > Matt
> >
> >
> > 
> 
> 
> 
0
Utf
3/13/2006 3:06:27 AM
Reply:

Similar Artilces:

convert the functions and formulas to values
Hi How to convert all the functions and formulas in the whole workbook to values without the method (copy, paste special as value) Thanks Why? Look at Value in the help for VBA Range("A1").Value = Range("A1").Value -- For everyone's benefit keep the discussion in the newsgroup. Regards, Peo Sjoblom "Mireille Abi Nader" <mireillea@newhorizons.com.lb> wrote in message news:7D82E49E-8709-4930-B8D6-7ED311A1F8C9@microsoft.com... > Hi, > How to convert all the functions and formulas in the whole workbook to values without the method (copy, paste ...

Is it possible to disable delete function?
I have a database and was wondering if it was possible to disable theuser from deleting anything at all or any objects whatsoever from thedatabase.Maybe if the database requires a password to delete objects, ordeleting objects was just disabled altogether would be of great help.If this is not possible then maybe a way to disable the databasewindow. I have it disabled on startup options but this can easily bebypassed by just opening it again.Many thanks to all help in advance. On Mar 29, 8:13 am, essseeproducti...@hotmail.co.uk wrote:> I have a database and was wondering if it was possible t...

Help with functions
If I have the following formula in a worksheet to bring up a message box =IF((F4-E4)>=10,Amend()+F4-E4,F4-E4) How can I use a function to transfer some information from different cells to a new worksheet if the formula above works? You can't have a function transfer information to another cell, it will return it's info in the cell where it's located, you would need a formula(s) in the cells where you want this information. Otherwise you would need VBA Regards, Peo Sjoblom "Monty" wrote: > If I have the following formula in a worksheet to bring up a me...

RE: linking Contact to Opportunities...
we are trying to solve an issue where we need to track a Contact's "role" to an opportunity...a contact can be associated to more than one opportunity so defining the role at the Contact level wont make sense and it seems that we can't customize the ContactOpportunity object (which links contacts to opportunities) ; does anyone know whether this will be customizable in v2-0? if not is there any way to customize the ContactOpportunity object? thanks! Sunish I know for a fact the CRM 2005 will offer more support across the board for customizing entities and relations...

How to Link/Associate Contacts information into Accounts
Good Morning, I have set up contacts in CRM, however, when I go to the Accounts section the only information displayed is the company name. How do I link the complete information that was entered into Contacts into Accounts without having to re-enter address info. etc.? I do have a primary contact set up in Contacts. I thought that the Contacts information would be automatically linked to the Accounts, and vice versa. I look forward to your response. Thank you. You won't be able to get the Contact's data to auto-populate the Account. I may have a solution for your issue, but...

Show email address instead of contact name
How can I make Outlook 2000 show the typed email address instead of resolving to the contact name in printouts of the contacts list and in the address boxes of email ? For example, I have a list of contacts in a custom list view with the email fields showing. Several of the entries in the email fields have resolved to the name of the contact. I want to see their email address not their name again. Also, a second example. I have three email addresses for a person, in the Email1, Email2, and Email3 fields. I go to send an email and instead of selecting the default from the addressbook/contact ...

IF Function #6
Hello, I want to use the IF function to perform certain calculation based on a value in a cell. I can manage that without a problem however my problem comes up when i want to use a range using OR within IF Lets say you have A1 with a value and you want certain value to be calculated based on it. IF A1 < 50,000 then it should do something but IF A1 is greater than 50,000 BUT less than 180,000 then it should do something, however IF A1 is greater than 180,000 and less than 250,000 then is should do something. I can manage the first bit but failing with the second comparison. Here'...

Using the "IF" function?
I setup a worksheet like below A B 1 Jan 123 2 Feb 543 3 Mar 654 4 Apr 456 5 May 645 6 Jun 543 7 Jul 0 8 Aug 0 9 Sep 0 10 Oct 0 11 Nov 0 12 Dec 0 13 When the end of the month, the user will enter some value in the B column, And now I would to setup a formula at A13, if the user enter the value in the B7, then the A13 will show Jul, when the user carry on to enter the value in the B8, then the A13 will change to show Aug, is it possible to setup a if formula or other formula rather than use the macro to doing this? Many Thanks. Ruff Try this: =INDEX...

Problem with vba directory function
Hi We have an access application that has a button when clicked opens an excel worksheet showing all exported data based on code The access sql system is in Citrix with a single front end copy. Here is the code part that is throwing the error for just one user. Rest all are working fine Dim strSourceFileName As String Dim WorkBookName As String strSourceFileName = "c:\CarLogOutPut\CarLogExportTemplate.xls" WorkBookName = "c:\CarLogOutPut\CarLogExport.xls" If Dir(strSourceFileName) = "" Then MsgBox "CarLogExportTemplate.xls doe...

Most logical value
I would like to know if there is a method of determining "the most logical" value in a table. These are some data that I put in the table below. These numbers are obtained from some dedicated software to compute the influence of an investment on some projects. I would like to fill in the gaps myself. I can add the data from column 10 en 20 and divide it by 2 to compute the value for column 15, but is there a better method? investment year 0 5 10 15 20 25 30 2005 72,8 72,8 72,8 72,8 72,8 72,8 72,8 2006 79,4 76,7 71,5 60,9 50,3 2007 92,3 87,4 76,9 55,6 33,5 2008 108,6 102,3 8...

Show which cell has MAX, MIN values?
At the bottom of a couple thousand rows of data, I have =MAX and =MIN formulas. Is there some way I could make the cells beneath my MAX and MIN formulas show me the address of which cell has the displayed MAX or MIN value? At least the row number? Ed Ed, To return the row =MATCH(cell with Max or Min value,range starting in row 1,false) or to return the address, say, in Cell N3000, for a value given in N2999 =ADDRESS(MATCH(N2999,N1:NN2998,FALSE),COLUMN(N1)) or to return other matching information, like a name in column A =INDEX(A:A,MATCH(N2999,N1:NN2998,FALSE)) HTH, Bernie MS E...

Want use results of Drop down list to look up a value
I am using Excel 2002 and I have a multisheet workbook and on the first sheet I have created a series of 6 drop down lists pulling from predefined named ranges. I also have limited subsequent choices based on what is selected in the other lists. The end result is the user will be selecting parameters that identify a product and now I am stuck with an easy way to look up the associated part number based on the parameters they selected. Essentially, once they have chosen the parameters in the list, I would like to create a macro that uses those values to locate the associated part...

100% Stacked Bar chart, two bars, want percent as well as real value
I am attempting to chart the following: Series 1 - Values over the prior 30 days Series 2 - Values over the prior 12 months I would like to show both data series as 100% bar charts, so users of the information can compare percentage of the last 30 days with percentage of the same piece of data over the last 12 months. So, for example the two data series might look like this: Series 1 20 25 45 65 Series 2 211 324 403 822 I want to display both the actual value, and the percentage of the total, for each series, in the labels. For some reason, showing percentage is not an option. Why is th...

Contact recognition problem
I have copied my OL2007 PST file to a new computer but I cant get OL2007 on the new computer to recognise my contact folders. (Address books) The option in contacts properties, etc.. to make them an Outlook address book is greyed out. I have two such contact/address books but I can only see/locate one. Any assistance would be appreciated. Andy Try a new mail profile and connect it to your .pst file you copied. -- Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. ALWAYS post your Outlook version. How to ask a question: http://support.microsoft...

refering to a name range area as a reference value multiple times on a worksheet at different locations
i was wondering if i had posted this in the right section as it could apply to both please could you take a look at the following post http://groups.google.com/group/microsoft.public.excel.misc/browse_thread/thread/f088a5737dd26570 thank you Is there some reason you can't post your question here instead of asking us to look elsewhere? -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett@gmail.com "Blinds Nottingham" <bradrail.blinds.awnings@googlemail.com> wrote in message news:d8768e43-e035-45eb-856a-0ccdc843441d@g1g2000yqi.googlegroup...

Default numeric value
I am creating a spreadsheet dealing with dollars. There are several formulas that I have created using percentages. One particular formula multiplies a percent in one cell by the $ value in another. If I have no $ value in the cell the formula uses a '1' instead of what I would expect '0'. How can I set up my sheet so that if a cell is blank the default value will be '0'? Would help to see your formula, but: =if(isblank(a1),"",a1*b1) ************ Anne Troy VBA Project Manager www.OfficeArticles.com "thomson" <thomson@discussions.microsof...

Data Validation in XL2007 suddenly stops functioning
I created a workbook in XL2003 that included some named ranges on Sheet2 that fed some data validation lists on Sheet1. Everything worked as expected. My colleague opened up the workbook in XL2007 and used it several times, and everything worked as expected. Then she called me, saying that it was broken. Of the 6 named ranges and related data validation columns on the other sheet, none of them were working anymore. I went over to her PC, and checked everything I could think of- I could set up working data validation test cells on Sheet2, but could not get the ones on Sheet1 to...

create pivot table formula without the GETPIVOTDATA function
Previous to Excel 2003 I could use a pivot table result in a formula and copy that formula as a relative reference. In Excel 2003 a GETPIVOTDATA fromula is created and uses an absolute reference. Is there a way in Excel 2003 to either make it arelative reference (without editing the formula) or revert to the method used in all prior releases? There are instructions here for adding the Generate GetPivotData button to a toolbar, and toggling the feature on and off: http://www.contextures.com/xlPivot06.html ebergkes wrote: > Previous to Excel 2003 I could use a pivot table resu...

lookup second / last match with two conditions
Hello, I've a table below, I want to setup an formula to get the result as shown at the bottom. Thanks in advance for your help. Column B C D Row 1st criteria 2nd criteria lookup value 3 A X 1 4 B Y 2 5 C Y 3 6 A Y 4 7 B X 5 8 C Y 6 9 D X 7 10 A Y 8 11 B Y 9 12 C X 10 query 1 query 2 criteria 1 A C criteria 2 Y Y nth of match 2 last Result 8 9 Please clarify: Why do you want 9 for query 2 rather than 6?? -- Gary''s Student - gsnu201001 ...

Outlook 2003
Hi I am using Outlook 2003 on a SBS network. I can see all the contacts in the public folders but I would like to see the folder in "My Contacts" at the top of the screen. Presently I have to open a whole cascading tree of folders to get to the Public Folder. Other users on the network have expressed an intrest in having a shortcut to the public folders shown in their own "My Cotacts" view. Any help would be appreciated. Many thanks Mark F -- Add the public contacts folder to your Public Folder Favorites. --� Milly Staples [MVP - Outlook] Post all replies to the g...

Reassigned CRM Contacts and Outlook
When a CRM contact is reassigned to another user, is there any means of getting it to import into the Outlook Contact list? So far no luck here... The reason that it is an issue is for inclusion on the users Blackberry contact lists. There is no way to export a contact into Outlook's contact folders. The method of making this available to mobile workers that Microsoft has provided is to use Microsoft CRM Mobile for Pocket PC 2003, but this won't do your BlackBerry user any good. Matt Wittemann http://icu-mscrm.blogspot.com "frappe33@gmail.com" wrote: > When a CRM ...

Auto Create Accounts to imported Contacts
I must import about 4500 contacts and I don't want to manually create all the accounts. Is there a way to auto create the accounts and associate it to the contacts? I can manually generate a Excel file with the name of the Account, and the address, but which is the best way to import it to CRM and then, associate the contacts to this accounts (without matching one by one) Thanks in advance -- Carlos Well, you can use the Data Migration Framework which can create both or you can write your own SDK-based code to do this. Matt Parks MVP - Microsoft CRM ------------------------------...

Unable to add a new contact in CRM 4.0
Hi all Unable to add a new contact in CRM 4.0 as it errors out saying "Object reference not set to an instance of an object". Here is the event log information. Web Service Plug-in failed in OrganizationId: 01f0210d-6bf6-4c27-8919-00eccab73e2d; SdkMessageProcessingStepId: ab0fa3e5-3ceb-dc11-8840-0003ffbb159c; EntityName: contact; Stage: 50; MessageName: Create; AssemblyName: AlertCRM40Plugin.CRM40PostPlugIn, AlertCRM40Plugin, Version=1.0.0.0, Culture=en-US, PublicKeyToken=4406fa73b5445f20; ClassName: AlertCRM40Plugin.CRM40PostPlugIn; Exception: Unhandled Exception: System....

Cash Recon Back Office Functionality to Log Variances against Shop
Interested in RMS Addition Software to Allow Management to Reconcile Individual EPOS Shifts and to Reconcile the Cash and to Log Variance against the employee who was using the EPOS during a Shift. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsof...

Import contacts from received E-Mail in OWA (Outlook Web Access 20
Hello, if one of our customers receives a E-Mail with Outlook 2003 contact in the appendix, the OWA customer can open the appendix without problems, but it is not possible to save the the new contact in his own contacts. The button "safe and close" is not available (button is grey). Windows/Exchange 2003 native enviroment (last servicepacks installed), Office 2003 SP2, Windows XP SP2 (IE6 SP2) Could it be an administrative task in our OWA config or could it be a security problem? We already have check the MS KB-Article (883575) for the IE6 security and popup-blocker problem. ...