You can do it in the onLoad event from the form of the entity.
The code looks like :
var oField = crmForm.all.subjectid;
var lookupItem = new Array();
if (oField.DataValue == null)
{
lookupItem[0] = new LookupControlItem ("{F73AD66F-BDF7-DA11-B79E-000C29B65286}", 129, "ABC");
oField.DataValue = lookupItem;
}
where : subjectid is the name of the field, "{F73AD66F-BDF7-DA11-B79E-000C29B65286}" is the guid of the default value, 129 is the type of the default value (by example : subject, account, contact, ...), "ABC" is the name which will be written on the form.
Comments
The code looks like :
var oField = crmForm.all.subjectid;
var lookupItem = new Array();
if (oField.DataValue == null)
{
lookupItem[0] = new LookupControlItem ("{F73AD66F-BDF7-DA11-B79E-000C29B65286}", 129, "ABC");
oField.DataValue = lookupItem;
}
where :
subjectid is the name of the field,
"{F73AD66F-BDF7-DA11-B79E-000C29B65286}" is the guid of the default value,
129 is the type of the default value (by example : subject, account, contact, ...),
"ABC" is the name which will be written on the form.