5. November 2009 18:17
crmForm.all.regardingobjectid.DataValue[0].id; // Die GUID des Datensatzes im Lookup
crmForm.all.regardingobjectid.DataValue[0].name; // Der Text, der im Lookup angezeigt wird
crmForm.all.regardingobjectid.DataValue[0].typename; // Der Typ des Datensatzes, der im Lookup angezeigt wird
var lookupitem = new Array();
lookupitem[0] = new LookupControlItem('58e9ce6d-021d-de11-a316-005056a11444', 10008, 'Test1');
crmForm.all.sulz_testid.DataValue = lookupitem;
var lookupitem = new Array();
var lookupitemobject = new Object();
lookupitemobject .id = '{6F7329E4-45C5-4393-A08E-6AE3AC070902}';
lookupitemobject .typename = 'uom';
lookupitemobject .name = 'Primary Unit';
lookupitem [0] = lookupitemobject;
crmForm.all.primaryUnit.DataValue = lookupitem;
crmForm.all.<lookupField>.DataValue = null;
if (crmForm.all.regardingobjectid != null) {
crmForm.all.regardingobjectid.setAttribute("defaulttype", "2");
var lookup = new Array();
var item0 = new Object();
item0.typename = 'account';
item0.id = '';
item0.name = 'Name1';
lookup[0] = item0;
var item1 = new Object();
item1.typename = 'account';
item1.id = '';
item1.name = 'Name2';
lookup[1] = item1;
crmForm.all.to.DataValue = lookup;
crmForm.all.<Name des Lookup Feldes>.lookupclass = "alllookups";