Show contact name in calendar

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SPO
    Senior Member
    • Jun 2020
    • 145

    #1

    Show contact name in calendar

    hi there, I need your help. I would like the name of the corresponding contact to be displayed.
    Version 9.1.3

    Unfortunately this does not work. what have I done wrong?


    thanks in advance



    custom/Espo/Custom/Resources/clients/custom-calendar.js

    define('custom:calendar-view', ['calendar:views/calendar/calendar'], function (Dep) {

    return Dep.extend({

    getEventTitle: function (model) {
    var title = model.get('name') || '';
    var parentName = model.get('parentName') || '';
    var parentType = model.get('parentType') || '';

    if (parentName) {
    var label = this.translateEntityType(parentType);
    title += ' | ' + label + ': ' + parentName;
    }

    return title;
    },

    translateEntityType: function (type) {
    var label = this.getMetadata().get(['entityDefs', type, 'label']);
    return label || type;
    }

    });
    });



    custom/Espo/Custom/Resources/metadata/clientDefs/Meeting.json

    ​{
    "calendarView": "custom:calendar-view"
    }



  • dreginald
    Senior Member
    • Sep 2018
    • 143

    #2

    Comment

    • SPO
      Senior Member
      • Jun 2020
      • 145

      #3
      Hey thank you for the answer!

      I came up with a solution of my own which successfully appends the name of the Lead to the meeting/appointment name.
      It uses the "," as seperator which does not allow you to use it during the naming process but it does the job!

      solution:
      if(array\length(string\split(name, ", ")) == 2){
      name = string\concatenate(array\at(string\split(name, ", "), 0), ", ", parentName)
      }
      else if(parentName != array\at(string\split(name, ", "), 1)){
      name = string\concatenate(name, ", " , parentName);
      };

      Comment

      Working...