Error when trying to add a new activity to the history of a connecred object

Symptoms

Implementation of the case:

  1. In the schedule, open an activity with the following fields populated on the "Connected to" detail: [Lead], [Invoice] and [Project/task];
  2. click the link to open the page of the connected object;
  3. open the "History" tab -> "Activities";
  4. add a new activity to the detail.

As a result, you receive a console error with the following message: 

message: Cannot read property 'replaceCls' of null.

The page of the new activity opens, but when you save and close all of the opened pages, you get back to the schedule displayed in a vertical list and see a blank space with inactive action buttons where the activity page should be. 

Cause

The openCardInChain method is blocked in ActivitySectionV2 as follows:

openCardInChain: function(config) {
   if (this.isSchedulerDataView() && (config.operation === ConfigurationEnums.CardStateV2.ADD)) {
      var historyStateInfo = this.getHistoryStateInfo();
      if (historyStateInfo.workAreaMode === ConfigurationEnums.WorkAreaMode.COMBINED) {
         this.closeCard();
      }
   }
   return this.callParent(arguments);
},

This code is available starting from version 7.3.0.

Solution

In version 7.7.0 this behavior must be corrected. To quickly correct it in the configuration, replace the ActivitySectionV2  schema and override the openCardInChain method in it as follows:

openCardInChain: function(config) {
   if (config.isLinkClick) {
      return false;
   }
   this.saveCardScroll();
   this.scrollCardTop();
   this.showBodyMask();
   var historyState = this.sandbox.publish("GetHistoryState");
   var stateObj = config.stateObj || {
            isSeparateMode: config.isSeparateMode || true,
            schemaName: config.schemaName,
            entitySchemaName: config.entitySchemaName,
            operation: config.action || config.operation,
            primaryColumnValue: config.id,
            valuePairs: config.defaultValues,
            isInChain: true
 };
   this.sandbox.publish("PushHistoryState", {
      hash: historyState.hash.historyState,
      silent: config.silent,
      stateObj: stateObj
   });
   var moduleName = config.moduleName || "CardModuleV2";
   var moduleParams = {
      renderTo: config.renderTo || this.renderTo,
      id: config.moduleId,
      keepAlive: (config.keepAlive !== false)
   };
   var instanceConfig = config.instanceConfig;
   if (instanceConfig) {
      this.Ext.apply(moduleParams, {
         instanceConfig: instanceConfig
 });
   }
   this.sandbox.loadModule(moduleName, moduleParams);
   return true;
}

 

Like 0

Like

Share

0 comments
Show all comments