Quote entity->Items. Select any entity from the QuoteItem->"up" arrow interface

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • worldmiros
    Senior Member
    • Dec 2015
    • 120

    Quote entity->Items. Select any entity from the QuoteItem->"up" arrow interface

    In the Quote entity, there is a "Items" section, there is "pencil" image that when click, I can add another item. After clicking the "+" sign to add another item, I can select a Product entity. What I want to be able to do, is select any other entity when I click the "up" arrow. For example, if I want to be able to add something from the Task entity from the "up" arrow in the invoice, I able to select Task entity to the left, and columns of task are visible to the right the same way the Product is. I don't want to delete ability to select Product from the Quote entity->Items. I want to select any entity. How would I go about doing that?
  • yuri
    Member
    • Mar 2014
    • 8478

    #2
    It's not so simple. I can just suggest to look to source code and try to customize it.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • worldmiros
      Senior Member
      • Dec 2015
      • 120

      #3
      yuri What source code (file) should I be looking at to cutomize? Would very much appreciate your response.
      Last edited by worldmiros; 01-11-2016, 03:33 PM.

      Comment


      • worldmiros
        worldmiros commented
        Editing a comment
        Are client\modules\advanced\src\views\quote-item\fields\names.js and application\espo\modules\advanced\hooks\quote\quot eitem.php the files I should be looking at?
    • worldmiros
      Senior Member
      • Dec 2015
      • 120

      #4
      Based on further reading files in the espocrm directory, I may have to create several files(task.json, taskbrand.json, taskcategory.json). Add some coding to files such as, name.js, edit.tpl, details.tpl, and select-record.tpl to do what I want it to do. Am I in the ballpark? And in the product.json, productbrand.json, and productcategory.json files, what is
      Code:
      "list": "Advanced: Product.List"
      "controller": "Controllers.Record"
      ? And if the code in the code tags above is a directory to some file,method, or object literal, where is that located? In detail.tpl, there is, "<a href='#Entity/view/'>. Where would I locate href in the espocrm directory?
      Last edited by worldmiros; 01-11-2016, 10:29 PM.

      Comment

      • worldmiros
        Senior Member
        • Dec 2015
        • 120

        #5
        yuri What files are responsible for the interface after clicking <span>glyphicon glyphicon-arrow-up</span> in the Quote entity->quoteitems. You said I need to look at the source code to customize it, but not sure which files are responsible for the interface to get an idea of what I have to do.

        Comment

        • yuri
          Member
          • Mar 2014
          • 8478

          #6
          I really don't remember. You can search in file contents by "glyphicon glyphicon-arrow-up" phrase.
          If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

          Comment

          • worldmiros
            Senior Member
            • Dec 2015
            • 120

            #7
            yuri I create Task.json file in the scope directory for the interface to display Tasks' data. Then in name.js, I change the scope to 'Task'. Tasks' data was visible and was able to select after I cleared cached. Listing different entities on the interface is for another day. Right now, I just want to list Tasks' data in the interface to add item. In name.js,
            Code:
             [COLOR=#000080][B]var [/B][/COLOR][COLOR=#458383]viewName [/COLOR]= [COLOR=#000080][B]this[/B][/COLOR].[COLOR=#7a7a43]getMetadata[/COLOR]().[COLOR=#7a7a43]get[/COLOR]([COLOR=#008000][B]'clientDefs.Product.modalViews.select'[/B][/COLOR]) || [COLOR=#008000][B]'Modals.SelectCategoryTreeRecords'[/B][/COLOR][COLOR=#cc7832];[/COLOR]
            and in the clientDefs, Product.json,
            Code:
             [COLOR=#660e7a][B]"modalViews"[/B][/COLOR][COLOR=#cc7832]: [/COLOR]{     [COLOR=#660e7a][B]"select"[/B][/COLOR][COLOR=#cc7832]: [/COLOR][COLOR=#008000][B]"Advanced:Task.Modals.SelectRecords" [/B][/COLOR]}[COLOR=#cc7832],[/COLOR]
            In the json file, is "select" value a file (tpl, js, or php), method, class, etc? And 'Modals.SelectCategoryTreeRecords', is that also a file or something else?
            Last edited by worldmiros; 01-15-2016, 09:26 PM.

            Comment

            • worldmiros
              Senior Member
              • Dec 2015
              • 120

              #8
              yuri After changing the scope of the interface to Task in name.js, I want to only allow user to select tasks for status that are completed or billed. How would I go about doing that?

              Comment

              • yuri
                Member
                • Mar 2014
                • 8478

                #9
                It's not so simple. Needs thinking.
                If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                Comment

                • yuri
                  Member
                  • Mar 2014
                  • 8478

                  #10
                  You can make your custom primaryFilter be applied in select popup. See how 'Active' filters is applied for assigned user field.
                  If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                  Comment

                  • worldmiros
                    Senior Member
                    • Dec 2015
                    • 120

                    #11
                    yuri I manage to set the quantity to tot_hours(task scope/entity) in name.js file for quoteitem. I have self created field called, "hourlyRate" in the matters entity, and want to set that value to listprice and unitprice. The relationship with matters to task, is parent-to-child. To get it, would it be?
                    Code:
                    var obj = this.model.parent.get('hourlyRate');
                    Last edited by worldmiros; 01-25-2016, 04:48 PM. Reason: made progress

                    Comment

                    • worldmiros
                      Senior Member
                      • Dec 2015
                      • 120

                      #12
                      yuri In matters entity, it's parent-to-child for matters => task entities. When I change the scope in name.js, I was able assign quantity to a created field in task entity called, tot_hours. I want to be able to retrieve hourlyRate in the matters, and due to the parent-to-child relationship with matters and task, I thought it will be possible to retrieve the field from matters entity some way in name.js file. Just don't how it's achievable.

                      Comment

                      • yuri
                        Member
                        • Mar 2014
                        • 8478

                        #13
                        You need to load parent model

                        PHP Code:
                        this.getModelFactory().get(parentType, function (parentModel) {
                           parentModel.id = parentId;
                           this.listenToOnce(parentModel, 'sync', function () {
                             var someFieldValue = parentModel.get('someField');
                             this.model.set('someField', someFieldValue);
                           }, this);
                           parentModel.fetch();
                        }, this); 
                        
                        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                        Comment

                        • worldmiros
                          Senior Member
                          • Dec 2015
                          • 120

                          #14
                          I've been searching how to create a button via the forum, so I can add one to perform an action during the scope being viewed in QuoteItems. To do, is it the code below?
                          Code:
                          this.menu.buttons.push({
                           'label':'Select Scope',
                          'action':'SelectScope',
                          'acl':'read'
                          });
                          I wrote the code above in the setup function, error occurs as follow, "​Uncaught TypeError: Cannot read property 'buttons' of undefined".
                          Last edited by worldmiros; 01-28-2016, 04:44 PM.

                          Comment

                          • worldmiros
                            Senior Member
                            • Dec 2015
                            • 120

                            #15
                            In name.js, scope is viewed. How can I create my custom button on the scope? I know when I change, createButton: true, a button is displayed that when clicked initiates creating an account, task, call, or whatever the scope is.

                            Comment

                            Working...