problem while converting a lead

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abidoss
    Senior Member
    • Mar 2023
    • 228

    problem while converting a lead

    Journal log


    [2024-10-10 15:13:51] CRITICAL: (0) validationFailure :: POST /Lead/action/convert :: /var/www/html/dev/application/Espo/Modules/Crm/Tools/Lead/ConvertService.php(388)
  • abidoss
    Senior Member
    • Mar 2023
    • 228

    #2
    [2024-10-10 15:25:51] DEBUG: API (0) validationFailure; POST /Lead/action/convert; Input data: {"id":"6707ea5cca37b61ed","records":{"Contact":{"c reatePortalUser":false,"portalsIds":["643ef4c189e22330b"],"portalsNames":{"643ef4c189e22330b":"Portail Consultant"},"portalRolesIds":["6496d96fe456c873f"],"portalRolesNames":{"6496d96fe456c873f":"Consulta nt"},"vTECH":"NON","vCOM":"NON","vCOACH":"NON","pU BCV":"NON","mAT":"NON","mAILING":"NON","cV":"NON", "int":0,"enci":0,"kopa":0,"kocl":0,"status":"New", "meteo":"SOLEIL","vISA":"OUI","entit":"CONSULT-IT","arrive":"Arrivée","typeContrat":"CDI FRANCE","profil":"IED PYTHON","mobilite":"Toute la France","lien":"https://xxx.xxxx.com/profil-detail?id=","charte":"❌","asap":"ASAP","lienVSA":" https://xxxx.xxxx.com/o_hr/hrmgnt/view/?user_id=","etatcv":"A validé","finPE":null,"alrt":true,"statPe":"En cours","nationalit":"Marocaine","cRequestType":nul l,"salutationName":"Mrs.","firstName":"Rim","lastN ame":"Test","middleName":null,"name":"Rim Test","title":null,"addressStreet":null,"addressCi ty":null,"addressState":null,"addressCountry":null ,"addressPostalCode":null,"emailAddressIsOptedOut" :null,"emailAddressIsInvalid":null,"emailAddress": null,"emailAddressData":[],"phoneNumberIsOptedOut":null,"phoneNumberIsInvali d":null,"phoneNumber":null,"phoneNumberData":[],"doNotCall":false,"description":null,"assignedUse rId":null,"assignedUserName":null,"teamsIds":[],"teamsNames":{},"teamsColumns":null,"campaignId": null,"campaignName":null,"targetListsIds":null,"ta rgetListsNames":null,"targetListsColumns":null,"co nsentsIds":[],"consentsNames":{},"consentsColumns":null,"arrive FR":"2024-12-02","disponibilit":null,"salariId":null,"salariNam e":null,"salaireBrutAnnuelCurrency":null,"salaireB rutAnnuel":null,"dateDpart":null,"cVthequesIds":["6707ea007cbe9ba13"],"cVthequesNames":{"6707ea007cbe9ba13":"Rim Bouchoucha"},"cVthequesColumns":null,"visiteursIds ":[],"visiteursNames":{},"visiteursColumns":null,"onbo rding":[],"dbutPE":null,"dateDeNaissance":null,"cTri":null, "salaireBrutAnnuelConverted":null,"disp":"Occupé"} }}; Route pattern: /{controller}/action/{action}; Route params: Array ( [controller] => Lead [action] => convert )
    [2024-10-10 15:25:51] CRITICAL: (0) validationFailure :: POST /Lead/action/convert :: /var/www/html/dev/application/Espo/Modules/Crm/Tools/Lead/ConvertService.php(388)

    Comment

    • abidoss
      Senior Member
      • Mar 2023
      • 228

      #3
      Up please

      Comment

      • rabii
        Active Community Member
        • Jun 2016
        • 1250

        #4
        The field type is not compatible between the two entities. You have different field type on both (It is necessary that the field type should be similar not only the name of the fields). Check fields on both leads and contacts (that are present on convert detail) and make sure the fields have similar type. e.g name on lead is (varchar) and on contact name should be also (varchar).
        Rabii
        Web Dev

        Comment

        • abidoss
          Senior Member
          • Mar 2023
          • 228

          #5
          Hello Rabii, I have checked the fields, and they are the same. There's no way to identify the field, as it's more difficult this way. I have several fields in each entity.

          Comment

          • lazovic
            Super Moderator
            • Jan 2022
            • 809

            #6
            Hi abidoss,

            I see that cRequestType attribute has nul l value, but it should have null value. Can you please take a look and see if this is how it looks in the logs? Maybe the forum just edited this part of the log that way.

            Comment

            • abidoss
              Senior Member
              • Mar 2023
              • 228

              #7
              Here is the log. Last time, I tried to add the same fields to prospects and contacts


              [2024-10-14 10:24:16] DEBUG: API (0) validationFailure; POST /Lead/action/convert; Input data: {"id":"6707ea5cca37b61ed","records":{"Contact": {"c reatePortalUser":false,"portalsIds":["643ef4c189e22330b"],"portalsNames":{"643ef4c189e22330b":"Portail Consultant"},"portalRolesIds":["6496d96fe456c873f"],"portalRolesNames":{"6496d96fe456c873f":"Consu lta nt"},"int":0,"enci":0,"kopa":0,"kocl":0,"status" :" New","vISA":"N/A","entit":"CONSULT-IT","arrive":"Arrivée","typeContrat":"CDI FRANCE","profil":"IED PYTHON","mobilite":null,"lien":null,"charte":null, "asap":null,"lienVSA":null,"etatcv":null,"finP E":n ull,"alrt":true,"statPe":"En cours","nationalit":"Marocaine","cRequestType":"MS P","salutationName":"Mrs.","firstName":"Raa","l ast Name":"Bo","middleName":null,"name":"Raa Bo","title":null,"addressStreet":null,"addressCi ty ":null,"addressState":null,"addressCountry":nu ll," addressPostalCode":null,"emailAddressIsOptedOut":f alse,"emailAddressIsInvalid":false,"emailAddress": "bo@gmail.com","emailAddressData":[{"emailAddress":"bo@gmail.com","lower":"bo@gmai l.c om","primary":true,"optOut":false,"invalid":fals e}],"phoneNumberIsOptedOut":null,"phoneNumberIsInv ali d":null,"phoneNumber":null,"phoneNumberData":[],"doNotCall":false,"description":null,"assigned Use rId":null,"assignedUserName":null,"teamsIds":[],"teamsNames":{},"teamsColumns":null,"campaignI d": null,"campaignName":null,"targetListsIds":null,"ta rgetListsNames":null,"targetListsColumns":null,"co nsentsIds":[],"consentsNames":{},"consentsColumns":null,"arr ive FR":null,"disponibilit":null,"salariId":null,"sa la riName":null,"salaireBrutAnnuelCurrency":null,"sal aireBrutAnnuel":null,"dateDpart":null,"cVthequesId s":["6707ea007cbe9ba13"],"cVthequesNames":{"6707ea007cbe9ba13":"Rim Bouchoucha"},"cVthequesColumns":null,"visiteursIds ":[],"visiteursNames":{},"visiteursColumns":null,"o nbo rding":[],"dbutPE":null,"dateDeNaissance":"2024-10-01","cTri":null,"disp":"Occupé","salaireBrutAnnu el Converted":null}}}; Route pattern: /{controller}/action/{action}; Route params: Array ( [controller] => Lead [action] => convert )
              [2024-10-14 10:24:16] CRITICAL: (0) validationFailure :: POST /Lead/action/convert :: /var/www/html/dev/application/Espo/Modules/Crm/Tools/Lead/ConvertService.php(388)

              Comment

              • abidoss
                Senior Member
                • Mar 2023
                • 228

                #8
                yuri
                lazovic
                rabii

                Is there a solution to bypass the problem, skip the field validation, or adopt a similar approach? I'm lost, and my CRM isn't working at the moment. Thank you for your help

                Comment

                • lazovic
                  Super Moderator
                  • Jan 2022
                  • 809

                  #9
                  abidoss,

                  Please tell me if you can create a new contact via API service (e.g., Postman or Reqbin), using exactly the same data in the payload as in the error presented above?

                  Comment

                  • abidoss
                    Senior Member
                    • Mar 2023
                    • 228

                    #10
                    Click image for larger version

Name:	image.png
Views:	109
Size:	9.1 KB
ID:	111256



                    [2024-10-15 14:38:52] DEBUG: API (0) validationFailure; POST /Lead/action/convert; Input data: { "id": "644a5b2fd567f795e", "records": { "Contact": { "createPortalUser": false, "portalsIds": [ "643ef4c189e22330b" ], "portalsNames": { "643ef4c189e22330b": "Portail Consultant" }, "portalRolesIds": [ "6496d96fe456c873f" ], "portalRolesNames": { "6496d96fe456c873f": "Consultant" }, "int": 0, "enci": 0, "kopa": 0, "kocl": 0, "status": "Sortant", "vISA": "OUI", "entit": "CONSULT-IT", "arrive": "Arrivée", "typeContrat": "CDI FRANCE", "profil": "Administrateur Système", "mobilite": null, "lien": null, "charte": null, "asap": null, "lienVSA": null, "etatcv": null, "finPE": null, "alrt": true, "statPe": "Valide", "nationalit": "Marocaine", "cRequestType": null, "salutationName": "Mr.", "firstName": "Driss", "lastName": "BOUDRAR", "middleName": null, "name": "Driss BOUDRAR", "title": null, "addressStreet": null, "addressCity": null, "addressState": null, "addressCountry": null, "addressPostalCode": null, "emailAddressIsOptedOut": null, "emailAddressIsInvalid": null, "emailAddress": null, "emailAddressData": [], "phoneNumberIsOptedOut": null, "phoneNumberIsInvalid": null, "phoneNumber": null, "phoneNumberData": [], "doNotCall": false, "description": "Ajouter un cv", "assignedUserId": "643e88fae345fb8d9", "assignedUserName": "Nabil ELALLETI", "teamsIds": [], "teamsNames": {}, "teamsColumns": null, "campaignId": null, "campaignName": null, "targetListsIds": null, "targetListsNames": null, "targetListsColumns": null, "consentsIds": [], "consentsNames": {}, "consentsColumns": null, "arriveFR": null, "disponibilit": "2023-03-21", "salariId": null, "salariName": null, "salaireBrutAnnuelCurrency": "EUR", "salaireBrutAnnuel": 50004, "dateDpart": "2023-06-07 00:00:00", "cVthequesIds": [], "cVthequesNames": {}, "cVthequesColumns": null, "visiteursIds": [], "visiteursNames": {}, "visiteursColumns": null, "onbording": null, "dbutPE": "2023-03-21", "dateDeNaissance": null, "cTri": null, "disp": "Occupé", "salaireBrutAnnuelConverted": 50004 } } }; Route pattern: /{controller}/action/{action}; Route params: Array ( [controller] => Lead [action] => convert )
                    [2024-10-15 14:38:52] CRITICAL: (0) validationFailure :: POST /Lead/action/convert :: /var/www/html/dev/application/Espo/Modules/Crm/Tools/Lead/ConvertService.php(388)

                    Comment

                    • abidoss
                      Senior Member
                      • Mar 2023
                      • 228

                      #11
                      lazovic When I create a contact, there's no problem. I encounter a problem when converting a lead (prospect)

                      Comment

                      • abidoss
                        Senior Member
                        • Mar 2023
                        • 228

                        #12
                        lazovic Thank you very much for your help. I tried with Postman and tested by removing one field at a time until I found the one causing the issue

                        Comment


                        • rabii
                          rabii commented
                          Editing a comment
                          was it the issue with field type ?

                        • abidoss
                          abidoss commented
                          Editing a comment
                          rabii, yes, exactly, the issue I found is with the 'enumeration' field type. In 'Lead', for example, I have a 'Visa' field with options (Yes, No, N/A), whereas in 'Contact', the 'Visa' field is of type 'enumeration' but remains empty
                          Last edited by abidoss; 10-16-2024, 12:26 PM.

                        • rabii
                          rabii commented
                          Editing a comment
                          Cool
                          Glad you sorted it now
                      • lazovic
                        Super Moderator
                        • Jan 2022
                        • 809

                        #13
                        abidoss,

                        Please tell me if I understand correctly that you also cannot create a contact through Postman?

                        Perhaps you remember after what actions the problems with converting began? Perhaps some new fields were created or the EspoCRM was upgraded?

                        I would appreciate additional details regarding this issue.

                        Comment


                        • abidoss
                          abidoss commented
                          Editing a comment
                          lazovic, The issue appeared after the update to version 8.4. Before, I didn’t have this problem with converting leads to contacts, even if the options in an 'enumeration' field remained empty
                      • mankongde
                        Junior Member
                        • Dec 2024
                        • 1

                        #14
                        I found this post after upgrading from version 6 something to the current version 8.4.2. Converting a lead would fail and the logs would provide the API validation failure noted in the initial post. In my case, should it help anyone in the future, my accounts page had a field for status. Wasn't a problem before the upgrade but it clashed with the lead status field.

                        My solution was to create a new field for the accounts, populate it with the options from the old field, then through mysql copy the old column to the new column and remove the old field through the Espo web interface.

                        Comment

                        Working...