Create entity of type Task

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • czcpf
    Senior Member
    • Aug 2022
    • 160

    Create entity of type Task

    Hello,

    I tried creating an entity of type "Task" by creating /espo/Custom/Resources/app/entityTemplateList.json


    Code:
    [
    "__APPEND__"
    "Task"
    ]
    ​
    However, upon rebuilding and trying to create the custom entity, I received all sorts of errors.

    My goal is to create custom Task entities (ie. SalesTask, EngineeringTask) as these may need more fields than what is available in default Task. I know I could add relevant fields to the "Task" entity (ie. "type": [Sales, Engineering, etc.] but that doesn't seem to really fit for what I'm trying to accomplish.

    The default Template manager Assignment::Task for example is generic as well and I would like to be able to customize the template (ie. Assignment::SalesTask) rather than try and implement IF/Then logic in Assignment::Task template if I were to take the approach above. What approach is recommended?




  • rabii
    Active Community Member
    • Jun 2016
    • 1250

    #2
    it doesn't work that way, entityTemplateList define predefined entity types in the template folder. i suggest that you just copy task entity resources and name it differently as you mentioned.
    Rabii
    Web Dev

    Comment

    • Kharg
      Senior Member
      • Jun 2021
      • 410

      #3
      Why don't you just create Event entities?

      Comment


      • czcpf
        czcpf commented
        Editing a comment
        I'm not familiar with an Event entity? Maybe you can elaborate. My understanding is an Event entity is for calls, meetings, emails. The primary purpose of what I'm trying to accomplish is as follows:

        I will run a cron job every day to audit an account. During the run, if I find anything that requires the user to fix, I was going to create the tasks, which upon assignment, trigger email to the user. These tasks would also show in the portal. I want to customize the email and the details of the task itself programmatically. Since the framework sends Assignment:Task emails anytime a user is assigned to a task (if you configure that in Notifications) I thought it would save me alot of time; instead of re-inventing the wheel and creating a custom Notification. If you can think of a better way to approach it using the framework please advise.
        Last edited by czcpf; 05-19-2023, 09:19 PM.

      • Kharg
        Kharg commented
        Editing a comment
        "Event – has Date Start, Date End, Duration, Parent, Status fields; available in Calendar and Activities panel (must be enabled at Administration > Settings)."

        From the custom event entity you can schedule reminders just as you would do for calls/meeting Or you could use advanced pack/formula/hook to send an email on creation. Or regular Notification settings by adding the new entity.
        Last edited by Kharg; 05-19-2023, 10:33 PM.
    • czcpf
      Senior Member
      • Aug 2022
      • 160

      #4
      Interesting, I’ll take a look.

      Comment

      • esforim
        Active Community Member
        • Jan 2020
        • 2204

        #5
        I think it a rather a bad option to create too many entity that serve the same purpose.

        For example: I wouldn't recommend to create SaleContact and EngineeringContact

        Using Filtering, Role and Permission would be better in my opinion. It also help for management if you use Report. And for EspoCRM admin if you use Formula, BPM, Workflow and the like.

        Right now there the default entity and about 10 custom Entity I already feel like the menu is too long, luckily the "Group" Entity menu feature came along in v7(?) help reduce the management of it.

        There also the pain of having to link these two SaleTask and EngineeringTask, together so the "ManagerGuyTask" can see if these two department done their job in two different Entity.

        My Contact entity have about 12 relationship and it is already annoying to browse through, many of which is empty though with only 1-2 relationship linked.

        Of course at the end of the day it is your choice to design as you see fit and it also about the user of the system...​ perhaps your plan might be "wow cool update" or "wtf why they (you) do this".

        Comment


        • czcpf
          czcpf commented
          Editing a comment
          I see your point. The main challenge I’m having is the email template. A task has a system notification email that can be sent when assigned or with the reminder. Sure, I can customize it to my liking but that may not apply for other tasks within the system.

          An engineer’s tasks are completely different than say a sales reps tasks. If I wanted to be able to quickly choose from a set of preset tasks for engineers Vs sales reps a generic “Task” entity with just a “description” field isn’t going to work. I don’t understand how filtering, permission, role would really help here. Unless your suggesting,

          1) create a “type” enum field in Task (generic, engineering, sales)
          2) based on “type” show sub-type in another enum field to choose from (ie. Engineering > new prototype, Sales > create presentation
          3) use formula logic inside the Notification template emails to change the structure based on type. We can use if/then/else stuff in System Templates right?

          I agree, this approach may actually be easier in the long run in this situation. It’s temping to create new entities vs using existing entities with show/hide fields and logic but in the long run, your right things can get too cumbersome.

        • rabii
          rabii commented
          Editing a comment
          you can add the (set layout) option so for your teams you can design a set of layout to show only specific fields of the task to a team e.g engineering teams their layout will have only fields related to engineering tasks and if you want to tied it up you can add a field scope level to each team to access only fields of task they are meant to use.
      • esforim
        Active Community Member
        • Jan 2020
        • 2204

        #6
        czcpf

        Whichever work, I guess you can only try and see. Unfortunately you sound like you have a big team and you can't experiment, whereas my user is very low so all change is dictate by me... You can only push forward and push forward once you create that system. Otherwise you have a "this change is bad... but reverting the change is bad as well" dilemma.

        Considering my usage, I have a different approach while still using the main default task entity, that is through "Relationship". Right now with Tasks you can only have 1 Parents, which isn't too good as that mean I can only link it to 1 relationship. I have other relationship I want to link as well (Multiple Contact or Multiple Account, or Multiple {custom}entity).

        To get around that I create multiples Task relationship, something you can considering using as well. The weakness of course is that these task don't show on the "sidebar" though. You can probably code it to be but I'm a code-less person.

        My system I revolve around the "Case" entity.

        From the Case entity, which is default BasePlus type, I have the normal Email, Meeting and Task sidebar. But it might be insufficient so I create a few relationship from Case-Task and add it to Bottom Panel for other usage.

        So you can perhaps do:
        CaseEngineeringTask (Case-Task)
        CaseSaleTask (Case-Task)

        I named mine Task1
        Click image for larger version

Name:	image.png
Views:	379
Size:	21.6 KB
ID:	92732

        Comment

        Working...