Is there a way to create a form to add multiple tech records.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Redwood
    Member
    • Jul 2020
    • 45

    Is there a way to create a form to add multiple tech records.

    I am hoping someone might have some insights into having a way to extend the clone process in Espo. I would like to create a form to enter a variable like 5 and have it create 5 records. For my purpose this would be like 5 electricians, 7 carpenters ect. It would create the records without the tech being assigned yet. If possible it would clone the other information like start time and end time and workorder name. I really appreciate any pointers on how to create this. It would be very helpful. Thank you!
  • esforim
    Active Community Member
    • Jan 2020
    • 2204

    #2
    Unless you have coding skill or can create one based on other people example then there is no chance of it happening!

    The only way I can think of doing this "quickly" is through Import and Export after editing the data in Spreadsheet software where you can quick duplicate or create template style.

    Aside from that method, you can take advantage of using workflow or formula to speed up your record creation, but there isn't anyway to quickly create multiple records out of the box.

    ---

    One thing I certainly want to able to quickly do is the Task record, where I can just type task and press enter and make additional information later. At this stage I haven't seen any CRM system that have a spreadsheet like speed or record creation in similar method.

    Comment

    • Redwood
      Member
      • Jul 2020
      • 45

      #3
      Thank you for your post espcrm, I know it is tough, but it has to happen. I know we have the ability to clone records so I am going to work on looking at that method and see if I can expand it. I will certainly post if I get a solution. It may take me a while but I am very persistent.

      Comment

      • esforim
        Active Community Member
        • Jan 2020
        • 2204

        #4
        Glad to hear that! You might want to look into "Button" https://docs.espocrm.com/development/custom-buttons/
        If you plan to implement a GUI for future use.

        In regard to Formula like might be useful for you: https://docs.espocrm.com/administrat.../#recordcreate
        Along with a "if" and a new field where you if the Field = 5, then 5 new record is created. If it Blank (or 0 zero) then do nothing.

        Comment

      • telecastg
        Active Community Member
        • Jun 2018
        • 907

        #5
        At this stage I haven't seen any CRM system that have a spreadsheet like speed or record creation in similar method.
        Then let's try to give that ability to Espo if possible, as I mentioned before I believe that Espo is far more than a great CRM package, it is a superb development platform for a myriad of potential applications

        Thank you for your post espcrm, I know it is tough, but it has to happen. I know we have the ability to clone records so I am going to work on looking at that method and see if I can expand it. I will certainly post if I get a solution. It may take me a while but I am very persistent.
        I respect the attitude

        We don't have anything like it in our application so I can't provide some code examples or promise to devote a lot of time to do it, but I will take a look and see if I can help.

        There are 2 approaches that I am thinking to tackle this project:

        All Front End:

        1) Create and insert a custom input field to accept a number (not tied to the entity at all or maybe defined as a non-storable field, not sure yet) and a custom button inside the Work Order detail view. Possibly using jquery to insert them in the afterRender() method.

        2) Assign a custom method "duplicateMultiple" as the OnClick action for the custom button above

        3) implement the "duplicateMultiple" method based on the native actionDuplicate method https://github.com/espocrm/espocrm/b...detail.js#L390 but modified to accept a number of objects input, only duplicate some selected fields and link the new entity objects to the current Work Order using a different API call https://docs.espocrm.com/development...ionships/#link so the new records are linked to the current Work Order

        Front End and Back End:

        1) Same as above.

        2) Define an OnClick event for the button to trigger an Ajax call to a custom entry point class, and use selected values from fields in the current work order as payload to send with the Ajax call.

        3) Create the custom Entry point class that invokes a custom Service class and send the payload to it. https://docs.espocrm.com/development/services/

        4) Create the custom Service class which receives the payload (number of records to be created and json object with fieldName: currentValue value pairs) and will create the new entity objects related to the Work Order using ORM https://docs.espocrm.com/development/orm/

        5) The custom Service will return a response to the entry point, which will in turn, return the response to the Ajax call at the Work Order detail view

        6) At the Work Order detail view, upon a successful response to the Ajax call, re-render the view to update all fields.

        The only reference that I have at his stage is for the Front End Back End approach, aside the documentation, is https://forum.espocrm.com/forum/deve...ss-limitations which follows a similar road map but starts from a drop down menu option at the top of the record detail view, not inside it.
        Last edited by telecastg; 08-07-2020, 10:47 PM.

        Comment

        • eymen-elkum
          Active Community Member
          • Nov 2014
          • 472

          #6
          Hi all,

          I will write down here my solution ideas, hope they are helpful, but all of them need to be coded (the thirst solution needs 3rd party extension):

          when I think in a solution I first think how to make it solve more than the target problem, not only the specific scenario

          First option: Quick Create Buttons
          In this solution we will have the ability to define buttons to be shown in the list page
          every button will has the following:
          - Detail Layout (you can set custom layout for every button)
          - pre defined fields value: u can pre set any fields of the entity with any value so that this button will always start with this set of values (Entity Data Template)
          You for sure must be able to set the button color, label and if u want modal view or full mode

          The second solution is to have Duplicatable fields, hope I can explain this correctly and clearly:
          In this way we add a new check box to the field manager options, so that fields will have a new check box named Duplicatable or something more meaningful.
          In this way we will manage the field to has + button where if we click it we will get new copy of that field, we can have multiple duplicatable fields on the same layout.
          When we save the back end will make n records from that submission when n = the number of copies of the duplicated fields,
          NOTE: all the created records will have the same value from the shared fields but different values from duplicated fields
          Means: every value of the duplicated field will produce special entity record.

          the second solution can be extended to have list of fields with one plus button, so when we press on plus we will have all the duplicatable fields repeated in a new line.

          The Third solution is to have two entities, in addition to my extension (need very little code (optional)):
          - The Parent: will hold all the shared fields
          - The child: this is the real entity, and will has copy of the same fields of the parent, you can use the foreign type of just copy the values from parent using the formula.
          - to create the child entities easily u add the inline list from my extension to the layout then just go to create new parent entity page then will have n child record created in one place.
          You just may need to override the create button on the child list to refer to the create page of the parent

          I finished, and hope I was good enough in explaining
          Last edited by eymen-elkum; 08-08-2020, 04:14 PM.
          CEO of Eblasoft
          EspoCRM Expert since 2014
          Full Stack Web Developer since 2008
          Creator of Numerous Successful Extensions & Projects​

          Comment


          • telecastg
            telecastg commented
            Editing a comment
            Hi,

            I like the generic usage approach and the user friendly detail focus. Perhaps an idea for an extension for cloud users or those that prefer not to code ?

          • eymen-elkum
            eymen-elkum commented
            Editing a comment
            Hi @telecastg,

            I am going to make an extension for this, and will update here ...
        • Redwood
          Member
          • Jul 2020
          • 45

          #7
          Hello, I wanted to post a couple of pictures of what we need to assign multiple skill records to a call table. Please let me know if anyone has any ideas about this. I am willing to do a bounty if someone can help with this. Thank you!!
          Attached Files

          Comment

          • telecastg
            Active Community Member
            • Jun 2018
            • 907

            #8
            Hi,

            I assume that this is part of your previous development of two conditional multilink fields.

            If the above is true, then what you would like is, that when you click "Create Work Order" from the Work Order list view, the Work Order detail view includes an input field where you enter a number (say 5) and a any other details (name, start, end, skill) and when you click "Save" Espo will create 5 Work Orders with the common name, start and end, and skill values but without the service tech entities specified, is this correct ?

            Comment

            • Redwood
              Member
              • Jul 2020
              • 45

              #9
              That is the idea. I want to open this up to portal users so they can self serv. The idea is exactly what you speculated. When creating a work_order the user has the ability to choose the skill, start date, end date and enter a variable number and then create the records without assigning the techs yet. I am committed to making this work however it is tough. I know it would be a great feature as I am sure that I am not the only one that would like to be able to create records by bulk numbers. Thanks so much for taking the time and if you have any ideas, I am all ears at this point. I do wonder if you have had any luck using Select Manager for creating different views for entities. I would really like to be able to use the user as techs. If I can figure out how to get Select Manager to choose the users that have a set of skills, it would be awesome. The main reason is, I have had no luck getting the "Scheduler" to work with the tech table. It also does not send assignments via email like it does for "assigned users" These are very helpful tools in Espo and it would be cool if I can do it. Take Care and thank you so much for all of the assistance that you have been providing all of us

              Comment

              • telecastg
                Active Community Member
                • Jun 2018
                • 907

                #10
                As always, you are very welcome and I appreciate that you are taking the time to post your solutions, so I am glad to help when I can.

                When creating a work_order the user has the ability to choose the skill, start date, end date and enter a variable number and then create the records without assigning the techs yet.
                I made a tutorial post on how the create records process works and how to make modifications to it. I think that you could use it as basis to implement the above.
                https://forum.espocrm.com/forum/deve...1398#post61398

                I do wonder if you have had any luck using Select Manager for creating different views for entities.
                I hardly use Select Manager because I haven't been able to figure out how to create filters that go beyond very basic conditions, like the values of other fields in the same entity. This is probably by design, but I don't know for sure.

                In my opinion, Espo has implemented what I refer to as "meta-language" for filtering that makes possible to use metadata or json objects to create SQL filters, which is very useful for implementing some options without actually coding, but this language is not documented, and unless you are familiar with the syntax is impossible (at least for me) to translate statements like these https://forum.espocrm.com/forum/deve...6703#post56703 into actual SQL so I just avoid using "meta-language" and stick to old fashion SQL

                To your point about getting the Scheduler to work with the Tech table (finally !), we don't use it so I can't offer any practical help on that, but Maximus posted a related post (actually the same where I asked about the "meta-language") https://forum.espocrm.com/forum/deve...6690#post56690 that I think addresses your goal, and here's a link to the scheduler class, in case you want to study it. https://github.com/espocrm/espocrm/b...r/scheduler.js
                Last edited by telecastg; 08-10-2020, 08:14 PM.

                Comment

                • telecastg
                  Active Community Member
                  • Jun 2018
                  • 907

                  #11
                  A possible way to use "User" instead of "Tech" and be able to do the multiple link filtering, would be to use the experimental feature multiple assigned users https://docs.espocrm.com/administrat...ssigned-users/ that Espo has where you can manually create the many-to-many relationships of User to Skill, User to Work Order, etc and the entity "User" could be used instead of Tech.

                  Not really sure if it would work or how to implement it, but maybe you want to look into it, it could give you the User functionality that you are missing in Tech....
                  Last edited by telecastg; 08-13-2020, 04:15 AM.

                  Comment

                  • Redwood
                    Member
                    • Jul 2020
                    • 45

                    #12
                    Tele, Thank you so much. I did try that solution a while back. The problem is that when I use the User entity, since I have to put the filter in the User JSON, it is looking for a skill in all instances of user. Meetings, Assigned users ect. I really love espo but trying to do simple filtering seems to be very difficult. Your solution worked great using another entity but we should be able to do a simple query to populate field values. As you stated (and it is true) the native language is not like standard anything and it is almost impossible to debug. I am going to keep slugging away at it in the hopes of getting there. Thanks again for all of your generosity.

                    Comment

                    Working...