Announcement

Collapse
No announcement yet.

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

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

  • 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

  • #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


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

      Cheers mate

      Comment


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

        Comment


        • #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


          • #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


            • #7
              Originally posted by joy11 View Post
              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...
              X