Good Day Experts,
Previously, I had a Read Only field (Subject on Service Activity Form) which was populated by 2 different drop down fields. An OnChange Event triggered this and all was fine. Now, I need to concatenante a Lookup Field (Service) + a drop down value (new_activitydetails) to populate the Subject in the same manner. Problem is, the Subject continues to be populated with "[object Object]" for the value of the Service field.
I might be barking up the wrong tree here, but I thought I read something about using an Array to grab the Service Lookup Field. This is what I came up with, but its still not working.
var lookupItem = new Array;
lookupItem = crmForm.all.serviceid.DataValue;
if (lookupItem != null)
var conn_str = "Provider=SQLOLEDB.1;Initial Catalog=MSCRM;Data Source=SQLSERVER;User Id=sa;Password=access321";
var conn = new ActiveXObject("ADODB.Connection");
var rs = new ActiveXObject("ADODB.Recordset");
var adOpenDynamic = 2;
var adLockOptimistic = 3;
var query = "SELECT IsNull(Name,'') Name
WHERE ServiceId='" + lookupItem.id + "' ";
conn.open(conn_str, "", "");
rs.open(query, conn, adOpenDynamic, adLockOptimistic);
if(!rs.bof && !rs.eof)
var aStr1 = new String(rs(0));
crmForm.all.subject.DataValue = aStr1.toString();
So, when finished, I need to grab this value and Concatenante it to the new_activitydetails drop down value. Any advice would be greatly appreciated.