THe below script is about as simple as they get. This redirect call is throwing an UNEXPECTED_ERROR
I tried with a customer as well and get the same error.
function OnBeforeLoad(type) { if(type == RECORD_STATE.DELETE) { return; } try { nlapiSetRedirectURL('RECORD', 'customrecord_phys_order', '71', false); } catch(err) { logException(err); } }