Announcement

Collapse
No announcement yet.

Custom view does not work anymore after update

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

  • Custom view does not work anymore after update

    Heyho,

    i just updated espo from 5.4.5 to 5.5.6 and the advanced pack to the latest version. I had some issues with the quotes and due to a forum post (https://forum.espocrm.com/forum/bug-...66-quotes-item) i reinstalled the advanced pack. Now i have one issue left.

    When i open a quote i get following error in my browsers console:

    HTML Code:
    Uncaught SyntaxError: Unexpected token <
        at eval (<anonymous>)
        at Espo.Loader._execute (espo.min.js?r=1550049382:17)
        at Espo.Loader.<anonymous> (espo.min.js?r=1550049382:17)
        at j (espo.min.js?r=1550049382:3)
        at Object.fireWith [as resolveWith] (espo.min.js?r=1550049382:3)
        at x (espo.min.js?r=1550049382:4)
        at XMLHttpRequest.<anonymous> (espo.min.js?r=1550049382:4)
    I have a custom view for the quote details and so i debugged it. If i disable the custom view it works properly. it seems that there is something wrong and may i have to change something in the custom view? here comes the code:

    HTML Code:
    Espo.define('Custom:Views.Quote.Record.Detail', 'Advanced:Views.Quote.Record.Detail', function (Dep) {
    
        return Dep.extend({
    
            setup: function () {
                Dep.prototype.setup.call(this);
                this.dropdownItemList.push({
                    name: 'printWord',
                    label: 'Print to Word'
                });
            },
    
            actionPrintWord: function () {
                this.createView('pdfTemplate', 'Modals.SelectTemplate', {
                    entityType: this.model.name
                }, function (view) {
                    view.render();
    
                    this.listenToOnce(view, 'select', function (model) {
                        window.open('?entryPoint=Word&entityType='+this.model.name+'&entityId='+this.model.id+'&templateId=' + model.id, '_blank');
                    }, this);
                }.bind(this));
            }
        });
    });
    
    would be nice if anyone could give me a hint.

    thanks!!

  • #2
    Originally posted by mimez83 View Post
    Heyho,

    i just updated espo from 5.4.5 to 5.5.6 and the advanced pack to the latest version. I had some issues with the quotes and due to a forum post (https://forum.espocrm.com/forum/bug-...66-quotes-item) i reinstalled the advanced pack. Now i have one issue left.

    ...

    Espo.define('Custom:Views.Quote.Record.Detail', 'Advanced:Views.Quote.Record.Detail', function (Dep) {
    Hi mimez,

    If you updated to AP 1,.33 and later see that all quote stuff has been moved to module 'Sales'... so, at minimum you have to subclass from Sales: Views.Quote.Record.Detail. Have a check to client/modules/sales/src/views/quote ...

    Have a look at Quote.json client def

    {
    "controller":"controllers/record",
    "filterList":[
    "actual",
    {
    "name":"approved",
    "style":"success"
    }
    ],
    "recordViews":{
    "detail":"sales:views/quote/record/detail",
    "detailSmall":"sales:views/quote/record/detail-small",
    "editSmall":"sales:views/quote/record/edit-small"
    },
    hope this helps,

    Michele
    Last edited by michib; 02-13-2019, 06:07 PM.

    Comment


    • #3
      Hey michib,

      thanks for your help. I changed the class definition and it is working again! thx!!!

      Comment

      Working...
      X