I added a custom form to the object object and bound some javascript to it.
I call the form using window.open and formId in the url to open the form and is used only to create object objects.
Inside javascript, I'm just trying to fill in some fields, but the Xrm.Page.data object is always zero.
$(document).ready(function () { Xrm.Page.getAttribute("ct_testfield").setValue('test');});
Thanks!
John
UPDATE: Obviously, $ (document) .ready () is run before the Xrm.Page.data object is loaded.
Instead, I used the Form Properties dialog to set my function to OnLoad.
I assume that $ .ready is triggered when the DOM is ready in an IFrame or whatever it lives in, and not in all other loadable resources.
Hope this helps someone else.
I will close it in 7 hours when I can :)
source share