Announcement

Collapse
No announcement yet.

Hide phone number and email not created by current user

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hide phone number and email not created by current user

    Hello All, I am new to ESPOCRM, i got an requirement that the Phone number / Email should be HIDDEN or LEAVE BLANK in the contact list view if that phone number / email is not created by the current user.

    phone.js

    Code:
     
     data: function () {     var phoneNumberData;     if (this.mode == 'edit') {         phoneNumberData = Espo.Utils.cloneDeep(this.model.get(this.dataFieldName));          if (this.model.isNew() || !this.model.get(this.name)) {             if (!phoneNumberData || !phoneNumberData.length) {                  phoneNumberData = [{                     phoneNumber: this.model.get(this.name) || '',                     primary: true,                     type: this.defaultType                 }];             }         }     } else {         phoneNumberData = this.model.get(this.dataFieldName) || false;     }      if ((!phoneNumberData || phoneNumberData.length === 0) && this.model.get(this.name)) {          phoneNumberData = [{             phoneNumber: this.model.get(this.name),             primary: true,             primary: true,             type: this.defaultType         }];     }      return _.extend({         phoneNumberData: phoneNumberData,         doNotCall: this.model.get('doNotCall')     }, Dep.prototype.data.call(this)); },
    console.log(this.getUser()); // I get the current user ID here // BUT how to get created user.

  • #2
    I used this.model.get('createdById') to get the Created By User ID. Thanks

    Comment

    Working...
    X