Hi,
Since we updated to Wave 2, I'm getting a script error when creating new Portal Comments in the Customer Service Hub.
The "Direction", "To" and "From" fields are no longer filled out automatically.The error "cannot read property 'web' of undefined'" regards the following script:
function initialize() { if ( Xrm.Page.ui.getFormType() == 1 && ( Xrm.Page.context.client.getClient() === Xrm.ClientName.web || Xrm.Page.context.client.getClient() === Xrm.ClientName.mobile ) ) { //Set the default value for direction code as Outgoing for Web Client. if ( Xrm.Page.getAttribute( "adx_portalcommentdirectioncode" ).getValue() != null ) { Xrm.Page.getAttribute( "adx_portalcommentdirectioncode" ).setValue( 2 ); } //Set From lookup field with the value based on current user. Xrm.Page.getAttribute( "from" ).setValue( [{ id: Xrm.Page.context.getUserId(), name: Xrm.Page.context.getUserName(), entityType: "systemuser" }] ); //Set To Lookup field value based on the Query String parameters passed from Case form. var parameters = Xrm.Page.context.getQueryStringParameters(); if ( parameters["partyid"] != null && parameters["partyname"] != null && parameters["partytype"] != null ) { var entityTypeName = null; if ( Xrm.Page.context.client.getClient() === Xrm.ClientName.web ) { var entityTypeCode = parseInt( parameters["partytype"], 10 ); entityTypeName = Xrm.Internal.getEntityName( entityTypeCode ) } else { entityTypeName = parameters["partytype"]; } Xrm.Page.getAttribute( "to" ).setValue( [{ id: parameters["partyid"], name: parameters["partyname"], entityType: entityTypeName }] ); } } }
Has anyone else encountered this problem since the Wave 2 update?