How to get the name of an Entity that has been renamed?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rgcadavos
    Junior Member
    • Jan 2017
    • 28

    How to get the name of an Entity that has been renamed?

    Hi All,

    I want to rename the Account Entity into 'Organization'. But the relationship panel's label from other entity like Contacts is still Accounts.

    I can hard-code the label under any relationships but I want it to be user-friendly of what name they want. I have extended the detail-bottom.js:

    Espo.define('custom:views/record/detail-bottom', 'views/record/detail-bottom', function (Dep) {

    return Dep.extend({

    setupRelationshipPanels: function () {
    Dep.prototype.setupRelationshipPanels.call(this);
    _.each(this.panelList, function(panel){
    if(panel.name === 'accounts'){
    panel.label = 'Organizations';
    }
    });
    }
    });
    });

    But i want the panel.label into the custom name of the Accounts. I cant see any option in this.getMetadata() to be of use??? Correct me if im wrong.

    Badly need help.

    Thanks
  • bandtank
    Active Community Member
    • Mar 2017
    • 379

    #2
    I had to manually go through a lot of code to rename all of the instances of Account to Client. I think I ended up changing even more than what's shown at the following link, but that was most of it if I recall correctly. I'm not exactly sure if this is what you want.

    I don't understand why I can't change the Accounts entity. I can add things to it, but I can't remove or modify any of the stock relationships. For example, I

    Comment

    • rgcadavos
      Junior Member
      • Jan 2017
      • 28

      #3
      Thanks for the reply, but im looking for an uprade safe and dynamic way for this.

      Cheers mate

      Comment

      • rgcadavos
        Junior Member
        • Jan 2017
        • 28

        #4
        After some digging. We can get the plural of the account label by using this.translate('Account', 'scopeNamesPlural').

        Comment

        • bandtank
          Active Community Member
          • Mar 2017
          • 379

          #5
          You can change that in the Entity Manager by clicking on Accounts->Edit, but that doesn't change it everywhere. You have to change the code if you want it to change in the whole application.

          Comment

          • joy11
            Active Community Member
            • Jan 2017
            • 113

            #6
            I don't think you need to recode anything. Try Administration > Entity Manager > Account > Relationships > edit the labels in these to change the display name on the panel. You'll probably need to clear all cache before it shows through.
            Last edited by joy11; 03-08-2017, 09:40 PM.

            Comment

            • bandtank
              Active Community Member
              • Mar 2017
              • 379

              #7
              Originally posted by joy11
              I don't think you need to recode anything. Try Administration > Entity Manager > Account > Relationships > edit the labels in these to change the display name on the panel. You'll probably need to clear all cache before it shows through.
              You're right. I looked in there the first time and the label was updated, but only on the row in the Relationship area. After clicking edit, the underlying labels were still wrong. Thanks.

              Comment

              Working...