Set lookup in JavaScript possible?

Hi,

I wonder if it is possible to set a lookup using javascript. According the 
sdk, I should set the id, the name and the typename which I do. However, 
nothing is displayed. Is it possible or is only possible from server side?
0
Utf
11/13/2007 5:11:02 PM
crm 35858 articles. 1 followers. Follow

2 Replies
582 Views

Similar Articles

[PageSpeed] 36

Hi,
Yes, it is possible and it is exactly like how it is mentioned in CRM SDK.

//Create an array to set as the DataValue for the lookup control.
var lookupData = new Array();
//Create an Object add to the array.
var lookupItem= new Object();
//Set the id, typename, and name properties to the object.
lookupItem.id = '{1AAC1363-01A1-DB11-8432-0003FF9CE217}';
lookupItem.typename = 'account';
lookupItem.name = 'A Bike Store';
// Add the object to the array.
lookupData[0] = lookupItem;
// Set the value of the lookup field to the value of the array.
crmForm.all.parentaccountid.DataValue = lookupData;

-- 
PLEASE do click on Yes or No button if this post is helpful or not for our 
feedback.

uMar Khan :: Freelance Consultant
My Email :: imumar at gmail dot com
My Blog :: http://umarkhan.wordpress.com


"m1sterd" wrote:

> Hi,
> 
> I wonder if it is possible to set a lookup using javascript. According the 
> sdk, I should set the id, the name and the typename which I do. However, 
> nothing is displayed. Is it possible or is only possible from server side?
0
Utf
11/13/2007 7:16:01 PM
Thanks!

"uMar Khan :: CRM Freelance Consultant" wrote:

> Hi,
> Yes, it is possible and it is exactly like how it is mentioned in CRM SDK.
> 
> //Create an array to set as the DataValue for the lookup control.
> var lookupData = new Array();
> //Create an Object add to the array.
> var lookupItem= new Object();
> //Set the id, typename, and name properties to the object.
> lookupItem.id = '{1AAC1363-01A1-DB11-8432-0003FF9CE217}';
> lookupItem.typename = 'account';
> lookupItem.name = 'A Bike Store';
> // Add the object to the array.
> lookupData[0] = lookupItem;
> // Set the value of the lookup field to the value of the array.
> crmForm.all.parentaccountid.DataValue = lookupData;
> 
> -- 
> PLEASE do click on Yes or No button if this post is helpful or not for our 
> feedback.
> 
> uMar Khan :: Freelance Consultant
> My Email :: imumar at gmail dot com
> My Blog :: http://umarkhan.wordpress.com
> 
> 
> "m1sterd" wrote:
> 
> > Hi,
> > 
> > I wonder if it is possible to set a lookup using javascript. According the 
> > sdk, I should set the id, the name and the typename which I do. However, 
> > nothing is displayed. Is it possible or is only possible from server side?
0
Utf
11/14/2007 10:02:01 AM
Reply:

Similar Artilces:

Is this possible to create a company from exisiting Company but with some of data
Hello Folks, Happy labor Day !!!!!! I have a very strange situation atleast for me. I have a company and now I need to create another company out of that and move some of the data but not all. Let's say I have 1000 items existed in a company and then I create another one and wish to move 300 items out of 1,000 and these 300 will not be in any sequence. By moving 300 items also means that that I want to move all other data related to these items like BOMs, GL Accounts, AR, AP, Sales Orders and Purchase Orders as well. Is there a way to slice the DB using any Import/Exp...

Javascript Error opening threads
In Windows XP General Discussions, when I click on a thread to expand it, it says 'loading' but there is a 'javascript 0' error message on the left side of the status bar. When I attempt to refresh the page, it says 'service temporarily unavailable.' Anyone else have this issue? What's the fix? The issue is that the newsserver for the web-interface is horked /again/. The fix is to access this and other MS newsgroups in your newsreader (e.g., Outlook Express). Setting up Outlook Express to access Microsoft newsgroups http://www.michaelstevenstec...

setting up new outlook mail account
i can not set up a new account on my outlook, i keep saying establish network connection with a correct sign but searching for my mail account shows X can you please advise Are you trying to setup a POP3 mail account or an Exchange account? Also, what version of Outlook are you using? "rashid" <rashid@discussions.microsoft.com> wrote in message news:C59D04C0-C1C9-4BD1-AE00-2009D25B221D@microsoft.com... > i can not set up a new account on my outlook, i keep saying establish > network > connection with a correct sign but searching for my mail account shows X > ...

OWA Set Rule problem
I have successfully install the Exchange 2003 with SP1 in the Windows Server 2003. Anything alright exclude the rules function in OWA. I try to set the rules from any then "move to" or "copy to" specify folder are no problem, but "forward to" other email address, its don't work. I try to input the email address in the contact and then select from the contact, but the result also don't work. The rules can save and I can receive the incoming email in the Exchange 2003/Outlook or OWA, but it don't forward to my specify email address. I try to...

How do I set up an argument which asks for multiple criteria
I am trying to use an argument that asks for one of three criteria (2345P, 8319T, or 7026J) in cell C108, and if it finds it, enters the amount of yet another cell, G108 into cell K108, and if not enters 0 into cell K108. It seems there are too many arguments for the "if" argument, and I can't seem to get the "lookup" argument to work either. Is there another argument I should be working with? Thanks -- Diver Try: =IF(OR(C108="8319T",C108="2345P",C108="7026J"),G108,0) "bj" wrote: > try in K108 > =if(or(c108=&qu...

How do I set the 'Set Synchronizing Client' field
We have a number of outlook clients using CRM that have the 'Set Synchronizing Client' select box greyed out. We need to tick them so that they are able to synchronize tasks etc. Can any one help me find out why these are greyed out and then set them so that they can synchronize thanks In my experience, that checkbox is always greyed out for the first install that is performed for a user. The only time that checkbox becomes active is if a second copy of CRM is installed for a user who already has CRM installed on another PC.... Normally the box is checked and grey. If that is...

How to set backcolour
Hello All I have a continuous form containing a number field (long integer) called [v_colour]. This field contains the number of a certain colour - as per the numbers that are used in the format properties for back colour etc. I would like to set the back colour for the form's [v_colour] text box to be the value of the field: e.g. If the value of [v_colour] in the first record is 255, I want the back colour of the textbox for that record to be bright red. I tried this as the OnLoad event for the form: [v_colour].backcolour = [v_colour].value .... but this resulted in the back colour of...

Applying Percent Decrease Across Set Periods
I have a column which includes dates when items were purchased. I have used the DATEDIF function to find the number of years between that date and today's date. I now want to decrease the purchase amount 10% for every year calculated via the DATEDIF function. Any ideas, is this possible, why can't I think...? -- Hunt&amp;Peck ------------------------------------------------------------------------ Hunt&amp;Peck's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=32961 View this thread: http://www.excelforum.com/showthread.php?threadid=527873 ...

Not possible to remove mail reminders in outlook 2002
Hiya, I have a big problem with old mail that keeps popping up as reminders. I've tried to start outlook with /cleanreminders and another parameter without luck. Is there anyway that I can delete these reminders for sure? My mail originally comes from outlook in office 97, I know use outlook 2002. The mail that I get reminders on are mails from that period. Very grateful for any help that you can give me. - Kjell Arne ...

Set Regional Settings but not Language
Hi I have a multi-language APP en-US, es-ES, it-IT I usually change Languages and Locales by using the CultureInfo to switch Languages System.Globalization.CultureInfo myCI = new System.Globalization.CultureInfo("es-ES"); My issue is - what if the user wants to View App in english and use the Regional Options on a PC in say Spain ??? If I change the CultureInfo to en-US then they can view APP in English ( English satelite assemblies) but date and numbers will be in US format If I change the CultureInfo to es-ES then date and numbers will be in Spain forma...

Reading Pane Settings
I did a search for an answer to this question and have not found one. If I missed an answer already posted, please direct me to the right place. I have Outlook 2007 and set up the "right" reading pane for my e-mail. Now when I go to my calendar it is set up the same way - calendar on the left (same size as the inbox) and then there is a blank space to the right that is the size of the reading pane/preview. To the right is the to-do bar (which I have no problem with). I don't know why there is a reading/preview pane on the calendar when there is nothing to preview, and I...

Work Hours setting excludes specified hours from Scheduling
I am miffed by this problem. I specify a work hour schedule for a user. When I schedule a CRM User as a Resource for a Service in Scheduling of a Service Activity with Requested Time of ASAP and click Find Available Times, the values for Avilable Times returned are outside of the Work Hours I specified for the user and not within the work hours. When I drill into the Work Hours for this User, the Calendar view shows Cross Day rather than 8:00AM - 5:00PM I speciied for work hours and editing the hours reveal the correct hours in the Work Hours. What gives? Never mind. Figured out w...

Is it possible to format a PSObject with a .ps1xml file?
This might be a totally ridiculous question...but here goes anyway: I have a couple of filters in modules that write PSObjects to output using code like: $x = New-Object PSObject -Property @{ one = "one" two = "two" } Write-Output $x There's just way more properties. How does one specify 'default' formatting styles for a System.Management.Automation.PSCustomObject like you can with other types using .ps1xml files? That may not even be the right question to ask. What I'd like would be a way to define the default formatting for ...

Outlook "Arrange By" option does not retain its setting
In outlook 2007, I use a custom view for my inbox, and I have the Group By option checked to"Automatically group according to arrangement." This has been workn flawlessly until today, when I realized Outlook did not like a particular mouse click; perhaps I clicked on the border of two options or some other anomoly that caused the window toflash once. The end result was that my Arrange By option changed to "From" when I had previously set it to "Conversation." Now, whenever I hange it backto "Conversation," leave the inbox and come back, ...

interactive buttons, multiple sets
hi folks I'm sure one of you good folks will save my bacon as usual I have a series of websites, all of which exhibit the same odd behavior with interactive buttons. I have a bunch of buttons in the left margin, each of which pulls up ( lets call it ) a chapter, and in each 'chapter' are a number of related pages. On the top of each page is an imbedded page which has 'page numbers' for all the 'pages' in that chapter. So, it's a grid where the 'vertical' buttons in the left margin and the 'horizontal' buttons at the top comb...

How do I set OOR
I have searched the help menu and have had no luck finding out how to set my outlook 200 to send an OOR (Out of Office Reply) Any assistance would be great If you are in an Exchange environment (ask your administrator if you do notknow) you can set the Out of the Office Assistant which is located under Tools. If you are not in an Exchange environment you can create a rule that replies on all e-mails. The downside of this is that you'll have to have your Outlook open all the time for the rules to process. Make sure you set some exceptions (for instance based on the subject field so ...

Is it possible to create a crm user without a domain login name?
Is it possible to create a crm user without a domain login name? Isn't domain logon name a required field? I heard somewhere that this was possible? We need to change some account's owners to future domain users. Domainlogname is required field in CRM Like --- (Microsoft\ba) and it means you need to create a user in CRM .Account always has an owner , which is CRM user. would like to hear if someone has some tricks to bypass the domainlogname :=) ------ Aamir Blog = http://mscrmsupport.wordpress.com/ IT is required when you create the user, but once you have created the user, ...

Set Focus
I have text box that I input data into and I was wondering if it is possible to set focus to the text box and avoid clicking on the box. I thought the term is Set Focus, but can't find any information or example that would help in doing so. Any help would be appreciated .. PPT 2003. Look at the following page for code to set focus on a text box: http://officeone.mvps.org/vba/activate_shape.html - Chirag PowerShow - View multiple PowerPoint slide shows simultaneously http://officeone.mvps.org/powershow/powershow.html "Phil K" <PhilK@discussions.microsof...

Set published amount of calendar information
Hey guys! Is there any way I can have Exchange 2000/2003 force the amount of time published in the outlook calendar? I know that you can go into the the calendar options and set the amount you want published, but is there a way to have exchange require the amount that is published so that I could get everyone to publish a year's worth of calendar data instead of one person being set at 2 months and another at 6 months and another at 12? Thanks! Mike On Thu, 29 Jun 2006 06:18:02 -0700, Mike <Mike@discussions.microsoft.com> wrote: >Hey guys! > >Is there any way I c...

Excel 2007: is it possible to get in the title bar the complete file name & path?
Hi everybody, not a major issue but... Is it possible to display the complete file name & path in the title bar of Excel 2007, by means of some kind of AutoOpen macro, for example? If so, what code should I write in the macro? Many thanks in advance for your kind help. with Brgds, Daniel Office 2007 newbie Hi. Use : Application.Caption = ActiveWorkbook.FullName Regards. Daniel > Hi everybody, > > not a major issue but... > > Is it possible to display the complete file name & path in the title bar of > Excel 2007, by means of some kind of AutoOpen macro, for e...

Publisher 2003 Need to set business card to Avery 5371 setting
I need to set the print settings so the business cardd that I created will print on Avery 5371 business cards Okay.........and your question is? -- JoAnn Paules MVP Microsoft [Publisher] "Jonathan" <Jonathan @discussions.microsoft.com> wrote in message news:187615DD-9EF1-42A2-8436-78E6E6C6ACE4@microsoft.com... >I need to set the print settings so the business cardd that I created will > print on Avery 5371 business cards Page setup, business cards, click change copies per sheet, type > .5 top, .75 side, zero gaps. Avery 5371 is a standard business card s...

Setting the Settings
Really quickly: How (exactly) does one get Publisher to remember the page settings I want. ie. every time I open a new document, I get centimeters, and usually, I'd prefer inches. I have not been able to find a "Save Settings" option anywhere. Can anyone help? thomas In Publisher 2000 it's Tools Options General tab Measurements unit box - select inches. OK That should do it. -- Don -------- Vancouver, USA - One of the great cities in one of the 45+ countries in America! "ThomasL" <tlammert@netcom.ca> wrote in message ne...

Lookup equals null
Hi I need help with a simple bit of Jscript. I need to hide a tab when a person opens the service actvity form and the 'Service' lookup does not contain data. I used the Onload event and the following bit of script: { if (crmForm.all.serviceid.DataValue[0].name == null) crmForm.all.tab1Tab.style.display = 'none'; } crmForm.all.serviceid.FireOnChange(); This does not seem to work properly. I think there is a problem with the ==null part of the script. The OnChange event works fine and is: if (crmForm.all.serviceid.DataValue[0].name== 'Support') crmForm.all.tab1Ta...

"Object or class does not support the set of events" Quick Question
All, I built a MS Access database in MS Access 2003, which I have set up in a shared folder. I have a form with some standard components such as text boxs, bottons. When a user updates the form I wish to record the time/date and username in the record. I have posted a copy of the code I'm using for the "BeforeUpdate" event below. Now this works fine on my machine and updates without a problem. However when a user on another machine (also using MS Access 2003) tries to update the same field, he gets the following error: "The expression Before Update you entered as the eve...

Strange permission Settings.
Hey folks I got a strange problem and i think it has somthing to do with permisions server end but it is possible this could also be a client side problem Okay so im on the support desk we have a number of users that access an exchange 2003 server using outlook 2003 some teams share access team maiboxes. When they try to add a custom field to (in tasks or email) on a shared mailbox they recive this error message "You do not have sufficient permission to perform this operation on this object. See the folder contact or the system administrator" But they have full rights to it an...