Zoeken in deze blog

Posts tonen met het label Lookup. Alle posts tonen
Posts tonen met het label Lookup. Alle posts tonen

maandag 6 september 2010

Eigenschappen van een lookup field uitvragen

In onderstaand voorbeeld zie je hoe je de verschillende eigenschappen van een lookup field kunt uitvragen:

function HandleOnChangeLookup()
{
if(crmForm.all.primarycontactid.DataValue != null)
{
var lookupItem = new Array;
lookupItem = crmForm.all.primarycontactid.DataValue;
 // The text value of the lookup.
alert(lookupItem[0].name);

// The GUID of the lookup.
alert(lookupItem[0].id);

// The entity type name.
alert(lookupItem[0].typename);

// The entity type code of the lookup: 1=account, 2= contact.
alert(lookupItem[0].type);
}
}

donderdag 26 augustus 2010

Beperken selectiemogelijkheden in een lookup

crmForm.all.regardingobjectid.lookuptypes = "1,2";
crmForm.all.regardingobjectid.lookuptypeIcons = "/_imgs/ico_16_1.gif:/_imgs/ico_16_2.gif";
crmForm.all.regardingobjectid.defaulttype = "2";

woensdag 25 augustus 2010

Standaard waarde in een lookup

var lookupItem = new Array();
lookupItem[0] = new LookupControlItem ("{3415DFD3-E170-DC11-A99F-0003FFB35B1C}", 4001, "Klachtenafhandeling");

crmForm.all.serviceid.DataValue = lookupItem;

Waarde van een lookup wegschrijven in een tekstveld

if(crmForm.all.parentcustomerid.DataValue != null)
{
LookupItem = crmForm.all.parentcustomerid.DataValue;
crmForm.all.new_companyname.DataValue = LookupItem[0].name;
}

Lookup automatisch openen

if(crmForm.FormType == 1)
{
if(crmForm.all.productid.DataValue == null)

{
crmForm.all.productid.click();
}
}

maandag 4 mei 2009

Twee lookup-fields koppelen

In de OnLoad:

//FILTEREN VAN CONTACTPERSONEN O.B.V. KLANTID
ContactpersonFilter = function()
{
if(crmForm.all.cov_bedrijfid.DataValue != null)
{
crmForm.all.customerid.lookupbrowse = 1;
crmForm.all.customerid.additionalparams = "search=<fetch mapping='logical'><entity name='contact'><all-attributes /><filter type='and'><condition attribute='parentcustomerid' operator='eq' value='" + crmForm.all.cov_bedrijfid.DataValue[0].id + "'/></filter></entity></fetch>";
}
}
ContactpersonFilter()

In de OnChange:

//LEEGMAKEN CONTACTPERSOON BIJ WIJZIGEN BEDRIJFSID
crmForm.all.customerid.DataValue = null;

//FILTEREN VAN CONTACTPERSONEN O.B.V. KLANTID
ContactpersonFilter();

donderdag 23 april 2009

Lookup-field default vullen zonder zonder GUID

countryPA = document.all.cov_landid_pa_d.getElementsByTagName("DIV")[0];
countryPA.innerText = "Nederland";
crmForm.all.cov_landid_pa.Lookup(true, true, "Nederland", true);