Custom Invoice record view

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Paulina
    Member
    • Feb 2022
    • 41

    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:	266
Size:	17.9 KB
ID:	89740
  • Kharg
    Senior Member
    • Jun 2021
    • 410

    #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

    • rabii
      Active Community Member
      • Jun 2016
      • 1250

      #3
      Originally posted by Paulina
      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:	266
Size:	17.9 KB
ID:	89740
      also you should extend the existing view of the invoice record/detail view.
      Rabii
      Web Dev

      Comment

      Working...