Announcement

Collapse
No announcement yet.

Custom Invoice record view

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

  • Custom Invoice record view

    Hi,

    I need to create custom Invoice entity record view. I need to add a button under 3 dots (see in the picture). In clientDefs/Invoice.json I added:
    Code:
    "recordViews": {
            "detail": "accouting:views/invoice/record/detail"
        }​
    client/modules/accouting/src/views/invoice/record/detail.js contains this code:
    Code:
    Espo.define('accouting:views/invoice/record/detail', 'views/record/detail', function (Dep) {
    
        return Dep.extend({
    
            setup: function() {
                Dep.prototype.setup.call(this);
                this.dropdownItemList.push({
                    name: 'Export to Accounting',
                    label: 'exportToAccounting',
                    style: 'default'
                });    
            },
    
            afterRender: function() {
                Dep.prototype.afterRender.call(this);
            },
        });
    });​
    but it didn't work. If I do the same e.g. in Account entity everything works fine. Does anyone know why this might not work in Invoice entity?

    Click image for larger version

Name:	image.png
Views:	216
Size:	17.9 KB
ID:	89740

  • #2
    HI Paulina,

    I think it would be better to define a custom dropdown alone instead of a custom view for the entire Detail recordView.

    Comment


    • #3
      Originally posted by Paulina View Post
      Hi,

      I need to create custom Invoice entity record view. I need to add a button under 3 dots (see in the picture). In clientDefs/Invoice.json I added:
      Code:
      "recordViews": {
      "detail": "accouting:views/invoice/record/detail"
      }​
      client/modules/accouting/src/views/invoice/record/detail.js contains this code:
      Code:
      Espo.define('accouting:views/invoice/record/detail', 'views/record/detail', function (Dep) {
      
      return Dep.extend({
      
      setup: function() {
      Dep.prototype.setup.call(this);
      this.dropdownItemList.push({
      name: 'Export to Accounting',
      label: 'exportToAccounting',
      style: 'default'
      });
      },
      
      afterRender: function() {
      Dep.prototype.afterRender.call(this);
      },
      });
      });​
      but it didn't work. If I do the same e.g. in Account entity everything works fine. Does anyone know why this might not work in Invoice entity?

      Click image for larger version

Name:	image.png
Views:	216
Size:	17.9 KB
ID:	89740
      also you should extend the existing view of the invoice record/detail view.

      Comment

      Working...
      X