Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > loops
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 19th April 15:18
kevin zø§v+ºË¢{&‰Ê貇ír‰
External User
 
Posts: 1
Default loops



I try to use a loop in an on event script and I get an error. Can I not use
loops? It's going to be a hell of a long script if I can't. Isn't
programming supposed to make life easier on both the user AND the developer?
I guess Microsoft only believes this some times. CRM certainly isn't very
programmer friendly.

KB
  Reply With Quote


  sponsored links


2 19th April 15:18
drew schaeffer­ìrž}÷«v+ºË¢{&‰Ê貇ír‰
External User
 
Posts: 1
Default loops



Could you provide a little more detail? What is the error that you are
getting? Do you mean the onChange event for a lookup field? Can you post


Drew Schaeffer
Internal Systems Developer
Infragistics Inc.
http://www.infragistics.com "Kevin" wrote:
  Reply With Quote
3 19th April 15:18
kevin zø§v+ºË¢{&‰Ê貇ír‰
External User
 
Posts: 1
Default My code


What I want to do. Pass the value of the selection, "which will be one of
the entries in the array", and I want to find the index of that entry. If
there is a way around it please help.

Code:

var supp = new Array(61);

supp[0] = "Allied Van Lines - Berger Transfer";
supp[1] = "Allied Van Lines - Nor-Cal Moving Services";
supp[2] = "Allied Van Lines - Whalen's";
supp[3] = "Anthro Corporation";
supp[4] = "Avis Rent-A-Car";
supp[5] = "Barn Door";
supp[6] = "Beckman Coulter";
supp[7] = "Bretford Manufacturing";
supp[8] = "Budget Rent A Car";
supp[9] = "Carlick Imaging Products";
supp[10] = "Carlick Imaging Products";
supp[11] = "Carlick Imaging Products";
supp[12] = "Centimark Roof Systems";
supp[13] = "Cleaning Technologies Group";
supp[14] = "Compucom Systems, Inc.";
supp[15] = "David Edward Company, Ltd.";
supp[16] = "DHL Express";
supp[17] = "Disys";
supp[18] = "DM Transportation Management Services";
supp[19] = "Egan Visual";
supp[20] = "Falcon Companies - Charlotte-Epic-Howe-Johnson-Thonet";
supp[21] = "Fisher Scientific";
supp[21] = "Fixtures Furniture";
supp[22] = "***lord";
supp[23] = "GovConnection";
supp[24] = "Grainger";
supp[25] = "Gunlocke Company";
supp[26] = "Hertz Corporation";
supp[27] = "Hewlett Packard (Compaq Computers)";
supp[28] = "High Point Furniture";
supp[29] = "Hireright";
supp[30] = "IBM";
supp[31] = "ICI Dulux Paint";
supp[32] = "Infocus";
supp[33] = "IVCi";
supp[34] = "JP Morgan Chase";
supp[35] = "KI (Texas Only)";
supp[36] = "KLN Steel Products Co.";
supp[37] = "M-D Wholesale Hardware";
supp[38] = "Menlo Worldwide";
supp[39] = "Milliken Carpet";
supp[40] = "Nova Solutions";
supp[41] = "OfficeMax - A Boise Company";
supp[42] = "Polyvision";
supp[43] = "Ricoh Corporation";
supp[44] = "***auer (Interlink Brands)";
supp[45] = "Shaw Contract Floor.";
supp[46] = "SKC";
supp[47] = "Smith Systems";
supp[48] = "Software House International (SHI)";
supp[49] = "Southwest Contract (Texas Only)";
supp[50] = "Specialty Underwriters, LLC";
supp[51] = "Steelcase - Braytonspaces (Healthcare) - Brayton International
- Details - Metro Furniture -Turnstone - Vecta";
supp[52] = "Technology Integration Group (TIG)";
supp[53] = "United Van Lines - Armstrong Relocation";
supp[54] = "United Van Lines - East End/Corrigan Moving & Storage";
supp[55] = "United Van Lines - Suddath Relocation Systems";
supp[56] = "VWR International (Centrifuges)";
supp[57] = "VWR International (LF)";
supp[58] = "VWR International (LP)";
supp[59] = "VWR International Canada";
supp[60] = "Xerox Corporation";

var text = "DHL Express";

for (i=0;i<supp.length;i++)
{
if (supp[i] == text )
{
alert(i);
}
}

I'm using the alert for testing purposes to see if i'm getting a number.
Once I do get the # then I can do some other stuff with it.

HOWEVER, if there is a way to just get the ID instead of the VALUE that
would bew FANTASTIC!

Thanks all.
KB
Error:
ERROR BOX.
Message: an error has occurred for more information please contact system
admin...

Thanks.
  Reply With Quote
4 19th April 15:18
drew schaeffer­ìrž}÷«v+ºË¢{&‰Ê貇ír‰
External User
 
Posts: 1
Default My code


that certainly is odd... I am having trouble with loops too. However, I
believe that you can get around using a loop in this situation.

event.srcElement.value will give you the text value of the selection
event.srcElement.returnValue will give you the attribute value for that
selection (the id).

I believe that this is what you are looking for. If anyone has any idea why
we can't get for loops to work in the onChange event please let us know.

Drew Schaeffer
Internal Systems Developer
Infragistics Inc.
http://www.infragistics.com
  Reply With Quote
5 19th April 15:18
kevin zø§v+ºË¢{&‰Ê貇ír‰
External User
 
Posts: 1
Default My code


I hate CRM!
Wouldn't have found that out if this NG didn't exist, thanks.
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666