Have you seen the custom scripts yet? It should make javascript development a lot easier.
var fieldObject = VSMCustomJS.GetFieldByDBName('CUSTOM_FIELD','');
var fieldValue = fieldObject.GetValue();
fieldObject.ClearValue();
fieldObject.SetError();
fieldObject.RegisterOnChangeHandler(resetError);
fieldObject.SetValue(4);
function resetError()
{
VSMCustomJS.GetFieldByDBName('CUSTOM_FIELD','').ClearError();
}
Same syntax for any field type. If CUSTOM_FIELD is a QD it will look up the value and set any linked fields. If its a problem type it will look up the value. If its a dropdown it will look up the value in the list. Also works on the portal too without posting back.
It will also work on different systems with different references for the extension field. Core fields are also supported.
Check out the user guide for a full list of supported features.