Показать сообщение отдельно
Старый 04.02.2008, 06:55   #3  
ShurikEv is offline
ShurikEv
CRM
 
213 / 28 (1) +++
Регистрация: 25.04.2006
Адрес: г. Новосибирск
Example
The following code example shows how to set values in a field of type Lookup. This example shows how to set the parent account lookup field on the account form.
//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;

Осталось главное - узнать id города (тут пример для организации). Может быть прописан по-разному: либо статически, либо значение вытаскивается из какой-то сущности по какому-то условию.
За это сообщение автора поблагодарили: Верба (1).