Convert Page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ryan_WHR
    Member
    • Feb 2016
    • 37

    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"
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #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

    • Ryan_WHR
      Member
      • Feb 2016
      • 37

      #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

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #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

        • theBuzzyCoder
          Senior Member
          • Feb 2018
          • 102

          #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

          • tanya
            Senior Member
            • Jun 2014
            • 4308

            #6
            Did you rebuild EspoCRM and refresh the page?

            Comment

            • theBuzzyCoder
              Senior Member
              • Feb 2018
              • 102

              #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

              • tanya
                Senior Member
                • Jun 2014
                • 4308

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

                Comment

                • theBuzzyCoder
                  Senior Member
                  • Feb 2018
                  • 102

                  #9
                  Hi tanya ,

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

                  Comment

                  • tanya
                    Senior Member
                    • Jun 2014
                    • 4308

                    #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

                    • tanya
                      Senior Member
                      • Jun 2014
                      • 4308

                      #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

                      • theBuzzyCoder
                        Senior Member
                        • Feb 2018
                        • 102

                        #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

                        • jaltz09
                          Junior Member
                          • Jun 2018
                          • 11

                          #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

                          • tanya
                            Senior Member
                            • Jun 2014
                            • 4308

                            #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

                            • khopper
                              Senior Member
                              • Sep 2017
                              • 329

                              #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...