Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Dynamics 365 Portal Comments / Timeline error

(0) ShareShare
ReportReport
Posted on by

Hi everyone,



we are currently running into an error when trying to create a portal comment via the timeline.


TypeError: Cannot read property 'web' of undefined


You can still write the portal comment after pressing "OK" on the error message without any other issues.
Our current assumption is that it has something to do with Xrm.Page being outdated.
How can we either solve the problem or prevent the error from being shown?

Below is the code of the webressource in question. The workaround with the newer APIs doesn't work here since we can't get the formContext here.
Does anyone know if MS is going to fix this in the near future?

Thank you for your help and best regards.

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 }] );​
         }            ​
     }​
}

 


  • RE: Dynamics 365 Portal Comments / Timeline error

    I have the same issue.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans