I'm customizing a form in Microsoft's CRM Dynamics Online, and need to set a field value to the current users's ID. I've got code that correctly pulls the SystemUserID, but I'm having difficulty getting the value into the form field.
//Lots of XML/SOAP stuff to pull the user information
var systemUserIdNode = entityNode.selectSingleNode("q1:systemuserid");
crmForm.all.FieldForUserID.DataValue = systemUserIdNode; //Fails silently
[Update] After some digging, I've updated my code based on the sample in the SDK. It now looks like this:
var userIdValue = new Array();
userIdValue [0] = new LookupControlItem(systemUserIdNode, 8, fullNameNode);
crmForm.all.new_useridfield.DataValue = userIdValue ;
However, this causes an error in the last line - "Object doesn't support this property or method". So I'm still stumped (even more so, as the sample is out of the SDK).