Announcement

Collapse
No announcement yet.

Adding Custom Button In Invoice Module

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

  • Adding Custom Button In Invoice Module

    Hi all,
    I need to add a custom button to the invoice entity.
    I found the documentation for this: https://docs.espocrm.com/development/custom-buttons/
    This suppose that I will need to edit metadata/clientDefs/Invoice.json
    My problem is that I want to keep my changes even if I upgrade EspoCRM.

    So my question is how can I add a custom button into a default entity while keeping my changes upgrade safe?
    Thank you in advance for your replies.

  • #2
    Hi,

    Create a file custom/Espo/Custom/Resources/metadata/clientDefs/Invice.json:

    Espocrm will merge the module file with the custom file,

    Note: the custom folder will never touched by any upgrade, so any work within custom folder will be totally safe upgrade
    Last edited by eymen-elkum; 06-26-2020, 05:28 PM.
    EYMEN ELKUM
    Eblasoft Ltd.
    ==============
    { Software Engineering }
    eymen@ebla-soft.com
    +90 536 689 1649

    Comment


    • #3
      Awesome! Thank you.

      Comment


      • eymen-elkum
        eymen-elkum commented
        Editing a comment
        You are welcome

    • #4
      I been reading on custom button and dig through a quite thread about them, still haven't gotten any luck to actually using the button, appreciate if you can report back with some live working example.

      I manage to see the button, able to click on it, but it either result in a "Nothing happen" or "error 404"

      Comment


      • #5
        espcrm i've done many buttons, can you let me know how i can help you? I think there are two methods of doing that, first is from client folder, second is through custom.

        Comment


        • #6
          Originally posted by emillod View Post
          espcrm i've done many buttons, can you let me know how i can help you? I think there are two methods of doing that, first is from client folder, second is through custom.
          Hi emilod,

          The only "idea" at the moment currently I have is, I'm trying to create an Button in Contact that can convert it to another entity (similar to to how Leads can be convert to Contact). So I read a couple of thread, and copy down the step, in particular with these two:

          https://forum.espocrm.com/forum/deve...d-custom-links
          https://forum.espocrm.com/forum/deve...custom-actions
          https://docs.espocrm.com/development/custom-buttons/

          Also read and explore through the Lead convert function but there isn't much of a "hand-holding guide" available.

          I can get those button to appear but the crucial step I believe to making it work is the "controller" part? Without some sort of controller the button is useless.

          It could be that I'm using the wrong controller or I create the file or code wrong, but I was hoping something (or anything) happen when I click the button. At this point, none of those 3 pages give me any success.

          So currently, just need a button that does "something", at least that way I can maybe find out how to do more basic stuff then (hopefully) more advance function.

          Comment


          • #7
            espcrm hmmm, i've done something similar.
            I have button which is showing after click small form of creating specific record in other entity with pre-filled fields based on record from where you click button.

            For example i have button in task entity. Button called "Create case" and based on that EspoCRM after click showing form of creating cases with filled fields like parentCase(which is the same like task parent), parentObject(which is task from which case was created) and other things. I've created that based on mechanism in Email module. You can check this, just open Email and click dropdown in right top corner

            Comment


            • #8
              Originally posted by emillod View Post
              espcrm
              For example i have button in task entity. Button called "Create case" and based on that EspoCRM after click showing form of creating cases with filled fields like parentCase(which is the same like task parent), parentObject(which is task from which case was created) and other things. I've created that based on mechanism in Email module. You can check this, just open Email and click dropdown in right top corner
              Oh that look good, can you provide clue or (if possible) guide how I can emulate that button feature?

              Comment


              • #9
                espcrm - sure. I'll be more than happy to do so.
                Are you fimiliar with Custom views for modules?

                Comment


                • #10
                  Originally posted by emillod View Post
                  espcrm - sure. I'll be more than happy to do so.
                  Are you fimiliar with Custom views for modules?
                  I'm quite ignorant in that aspect emillod, as far as I went with any custom code, it is current a "copy and paste" for me until I get more knowledgeable.
                  But I have a tenancy to keep trying if it seem like it possible for me to do, but once if it too advance I probably just write a long report of my failure.

                  Comment


                  • #11
                    espcrm can you tell me what you want to achieve? I mean what you want to button do for you. Open new website? Copy something?

                    Comment


                    • #12
                      Originally posted by emillod View Post
                      espcrm can you tell me what you want to achieve? I mean what you want to button do for you. Open new website? Copy something?
                      As a learning, just a button let in (for example): Contacts > click ... > Create Account. Then field the is automatic copy from Contact to Account (such as Name, address, phone, etc), similar to how "Create Task" in Email would copy the Name, prefix the word "Email:", copy Email Content into Description.


                      In the future, I hoping to be able to do this after I learn how to do the above, the more advance and compliment button I would like to be able to do is in the Email system as well. Where click the "down arrow" in the From email would give these option, "Create Contact, Create Lead, Add to Contact, Add to Lead". These "Add to" button is quite good to copy data over.

                      Comment

                      Working...
                      X