Announcement

Collapse
No announcement yet.

Convert Page

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

  • Convert Page

    I am looking for the lead convert layout page code. I need to completely remove 2 options so they are not visible in the layout

    Could someone point me in the right direction i am trying to find the code to edit "preferably in a custom upgrade safe way"

  • #2
    Hi.
    You can do it even in Layout Manager
    Account, Contact and Opportunity have "Convert Lead" view.
    for example - {pathToEspo}/#Admin/layouts/scope=Contact&type=detailConvert

    Comment


    • #3
      Thank you i understand i can edit the details of the layout but i can not remove a option altogether so i just need to remove the code. Could you point me to the right area of code

      Comment


      • #4
        if I understand you well, create (look for) a file custom/Espo/Custom/Resources/metadata/entityDefs/Lead.json and leave what you need from this (got from application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json)
        Code:
        "convertEntityList": [
                "Account",
                "Contact",
                "Opportunity"
            ],
            "convertFields": {
                "Contact": {
                },
                "Account": {
                    "name": "accountName",
                    "billingAddressStreet": "addressStreet",
                    "billingAddressCity": "addressCity",
                    "billingAddressState": "addressState",
                    "billingAddressPostalCode": "addressPostalCode",
                    "billingAddressCountry": "addressCountry"
                },
                "Opportunity": {
                    "amount": "opportunityAmount",
                    "leadSource": "source"
                }
            },

        Comment


        • #5
          Hi tanya ,

          This is what i have now,


          espocrm/custom/Espo/Custom/Resources/metadata/entityDefs/Lead.json
          Code:
          {
              "convertEntityList": [
                  "Contact",
                  "Opportunity"
              ],
              "convertFields": {
                  "Contact": {
                  },
                  "Opportunity": {
                      "amount": "opportunityAmount",
                      "leadSource": "source"
                  }
              }
          }
          It is still giving me this

          Click image for larger version  Name:	data.png Views:	1 Size:	13.6 KB ID:	35042

          I just want contact and opportunity checkbox to show up.

          I have also cleared the local cache
          Last edited by theBuzzyCoder; 02-26-2018, 11:34 AM.

          Comment


          • #6
            Did you rebuild EspoCRM and refresh the page?

            Comment


            • #7
              tanya

              Yes, I did.

              php -f clear_cache.php
              php -f rebuild.php
              log out
              login
              convert

              in that order
              Last edited by theBuzzyCoder; 02-26-2018, 11:42 AM.

              Comment


              • #8
                You can do it in Administration panel as well. I'he just tested your code and get correct result

                Comment


                • #9
                  Hi tanya ,

                  Can you please tell me how to do it in administration panel

                  Comment


                  • #10
                    In menu (if you are an Administrator), you can find Administration item. In Administration in the section System you can Rebuild the system (the last item)

                    Comment


                    • #11
                      espocrm/custom/Espo/Custom/Resources/metadata/entityDefs/Lead.json
                      Did you share all the content? (this, you shared is valid and works for me good)
                      Do you run php command as server (apache) user?
                      Is espocrm/custom/Espo/Custom/Resources/metadata/entityDefs/Lead.json readable for server user?

                      Comment


                      • #12
                        Hi tanya ,

                        I had to do clear cache in Administration panel rather than in clear local cache. It started working now.

                        Thank you for the quick responses.

                        Comment


                        • #13
                          Hi tanya ,

                          There's no Lead.json file on my end. Also... I've tried creating the file and embed the code...
                          it's not working on my end... Is this for PRO package?

                          Comment


                          • #14
                            No, it's basic EspoCRM. If you don't have the file in custom folder, you can create it.
                            Is created file valid? Did you clear the cache in Administration?

                            Comment


                            • #15
                              Is it possible to copy 2 fields into 1 field "firstName" & "lastName" of Entity LEAD when converting to an Opportunity field "customerName"?
                              in file: custom/Espo/Custom/Resources/metadata/entityDefs/Lead.json

                              Code:
                                  "convertFields": {
                                      "Contact": [],
                                      "Opportunity": {
                                          "amount": "opportunityAmount",
                                          "leadSource": "source",
                                          "name": "accountName"        
                                      }
                              Something like this maybe?

                              Code:
                                  "convertFields": {
                                      "Contact": [],
                                      "Opportunity": {
                                          "amount": "opportunityAmount",
                                          "leadSource": "source",
                                          "name": "accountName",
                                          "customerName": "firstName" & " " & "lastName"
                                  }

                              Comment


                              • khopper
                                khopper commented
                                Editing a comment
                                I have also tried this without success doing a concat

                                "customerName": "firstName.concat(' ',lastName)"
                            Working...
                            X