Announcement

Collapse
No announcement yet.

Add custom text color to field

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

  • #16
    Tried to apply colors to Lead, but without a success. Code from custom\Espo\Custom\Resources\metadata\entityDefs\L ead.json below:
    "status": {
    "type": "enum",
    "options": [
    "",
    "Payment",
    "Admission",
    "Visa",
    "Start",
    "Paused",
    "Commission claim",
    "Visa refusal",
    "Cancel",
    "Follow up"
    ],
    "default": "Payment",
    "view": "views/fields/enum-styled",
    "style": {
    "Payment": "success",
    "Commission claim": "danger",
    "Follow up": "danger",
    "[option]": "[style]"
    },
    "required": true,
    "isPersonalData": false,
    "isSorted": false,
    "readOnly": false,
    "tooltip": false
    },
    Also in case field is marked as "link" in Layout manager - will it work also? I suspect that I need to change code somewhere else)

    Comment


    • #17
      example https://github.com/espocrm/espocrm/b...s/Task.json#L8
      1. "[option]" - you don't have this option in "options", why did you add it?
      2. after fixing check, if json is valid.
      3. Administration > Clear Cache > Refresh the page
      4. It won't work if you use it as link, but you can fix it
      EspoCRM – Open Source CRM Application. Contribute to espocrm/espocrm development by creating an account on GitHub.

      Comment


      • Anatoleq
        Anatoleq commented
        Editing a comment
        Hi Tanya, Fixed Lead.json by removing "[option]", but still no colors applied. Using it not as link. Json is valid btw.

    • #18
      Originally posted by tanya View Post
      example https://github.com/espocrm/espocrm/b...s/Task.json#L8
      1. "[option]" - you don't have this option in "options", why did you add it?
      2. after fixing check, if json is valid.
      3. Administration > Clear Cache > Refresh the page
      4. It won't work if you use it as link, but you can fix it
      EspoCRM – Open Source CRM Application. Contribute to espocrm/espocrm development by creating an account on GitHub.

      https://github.com/espocrm/espocrm/b.../list-link.tpl
      I'm editing the custom json on /custom/Espo/Custom/Resources/metadata/entityDefs/, as bellow (marked the added lines), but it is not working. Help me please!!!

      {
      "fields": {
      "stage": {
      "type": "enum",
      "options": [
      "Prospecting",
      "Value Proposition",
      "Id. Decision Makers",
      "Negotiation/Review",
      "Ganho sem arquivar",
      "Closed Won",
      "Encaminhado para Parceiros",
      "Closed Lost"
      ],
      "view": "crm:views/opportunity/fields/stage",
      "default": "Prospecting",
      "audited": true,
      >> "style": {
      >> "Ganho sem arquivar": "success"
      >> },

      "required": false,
      "isSorted": false,
      "probabilityMap": {
      "Prospecting": 10,
      "Value Proposition": 30,
      "Id. Decision Makers": 70,
      "Negotiation/Review": 0,
      "Ganho sem arquivar": 100,
      "Closed Won": 100,
      "Encaminhado para Parceiros": 0,
      "Closed Lost": 0
      },
      "fieldManagerAdditionalParamList": [
      {
      "name": "probabilityMap",
      "view": "crm:views/opportunity/admin/field-manager/fields/probability-map"
      }
      ],
      "readOnly": false,
      "tooltip": false
      },

      Comment


      • #19
        this field has own view, with own hardcoded style


        you need to use own view for this field

        Comment


        • #20
          Originally posted by tanya View Post
          this field has own view, with own hardcoded style


          you need to use own view for this field
          Hi Tanya, I didn't understand. I can't use custom json? What do you mean?
          ​​​​​​Thanks

          Comment


          • #21
            No, you can change entityDefs in custom, but you use the default view of this field, This view does not support style definition in entityDefs
            Read this article https://www.espocrm.com/documentatio.../custom-views/ Field View

            Comment


            • #22
              In the newest version you can set option color in Entity Manager

              Comment


              • #23
                The different colours are not easy to distinguish for people with glasses. The lines of the font are too narrow.
                of an alternative :

                Comment


                • #24
                  In 5.5.3 it's possible to display enum fields as labels (a new field parameter).

                  Comment


                  • #25
                    Hi
                    I am working on espocrm.
                    can anyone please tell me that how can i add text here ?
                    I want to show a message when there is some data only on this page.
                    Attached Files
                    Last edited by swati; 05-20-2019, 10:09 AM.

                    Comment


                    • #26
                      In order to make your customization "upgrade safe" you need to:

                      copy the code from client/res/templates/list.tpl to a custom template "client/custom/res/templates/list.tpl"
                      insert a div tag with your text inside it above the line <div class="list-container">{{{list}}}</div>

                      copy the code from client/src/views/list.js to a custom view "client/custom/src/views/list.js"
                      modify the line template: 'list' with "template: 'custom:list'" to call the above custom template

                      specify your custom view at the parent entity's ("Floor") clientDefs as:
                      "views": {
                      "list": "custom:views/list",
                      "detail": "custom:views/generic/detail/header/close"
                      },

                      Comment


                      • #27
                        Thanks you so much for this solution. I also want to ask one more thing when i select any record from Floor entity (it's a custom entity), it is always select it's id. i want to select it's office number.
                        Can you please help me out.
                        Attached Files

                        Comment


                        • telecastg
                          telecastg commented
                          Editing a comment
                          Sorry, not sure why is doing that, perhaps some other member or someone from the development team can explain why.

                          What I can do is give you an example of how I created a many-to-one relationship in my application and hopefully that will help:

                          I have a "Tenancy" entity that can have one or more "ServiceTicket" entities linked to it, so after I created both entities I went to Administration>>Entity Manager>>ServiceTicket>>Relationships and created a link type many-to-one mapped to Tenancy. Then I went to Administration>>Layout Manager>>ServiceTickets>>Detail and added the field "Tenancy" to the detail layout.

                          Lastly, since Espo shows the "name" field of the Tenancy in the dropdown box in ServiceTicket detail view, and I wanted to display the property address, I used formula to put the property address as "name" in the Tenancy entity, then I can see that field when selecting a Tenancy from the ServiceTicket detail view.
                          Last edited by telecastg; 05-21-2019, 06:24 PM.

                        • swati
                          swati commented
                          Editing a comment
                          Hi Telecastg, thanks for this reply.
                          I replace office number by name and it is working now. Thank you so much.

                      • #28
                        Hi, How can i call getMailSender() from "\Espo\Services\Email" in my custom cron job. when I extends "\Espo\Services\Email" it gives me " Espo.ERROR: Uncaught Exception Error: "Call to a member function getScopeRestrictedAttributeList() on null" at /var/www/html/EspoEspoLatest/application/Espo/Services/Record.php line 155 {"exception":"[object] (Error(code: 0): Call to a member function getScopeRestrictedAttributeList() on null at /var/www/html/EspoEspoLatest/application/Espo/Services/Record.php:155)"}" error.
                        and when i create "\Espo\Services\Email" object and then call getMailSender(), it gives me you can't call protected method error.

                        Please help me out, I haven't found anything for this
                        Last edited by swati; 06-11-2019, 09:35 AM.

                        Comment


                        • #29
                          how can i set up cron job to execute a URL ?
                          I set my URL like "0 10 * * * curl -s "url..." > /dev/null" in "sudo crontab -u www-data -e" at end of the file But this is not working.

                          Comment


                          • #30
                            how can i set condition on type = link muliple. like i have a field "customer name" of link multiple. when i select customer name it shows me all the name but i want only those name whose stage is "closed won".
                            Attached Files

                            Comment


                            • Maximus
                              Maximus commented
                              Editing a comment
                              I have notice that you have violate the copyright rights on your EspoCRM instance. Due to the EspoCRM license you cannot remove EspoCRM copyright at the footer of the page. Please fix it.

                            • swati
                              swati commented
                              Editing a comment
                              Sure, I will fix it.

                            • swati
                              swati commented
                              Editing a comment
                              Can you please tell me how can i set condition on type = link muliple.
                          Working...
                          X