I am trying to set the default product for the order product. I use script below on the form's onLoad event.
function SetDef(){ lookup = Xrm.Page.getAttribute('productid').getValue(); if (lookup == null) { Xrm.Page.getAttribute('productid').setValue([{id: '31F65B93-30ED-E211-9B99-EE3A97CBB23B', name: 'Service', entityType: 'typeproduct'}]); } }
I only get this:
I have no idea what is wrong. The same script worked for default customer for order form.