Announcement

Collapse
No announcement yet.

Error 500 Bad Foreign Value for Case

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

  • Error 500 Bad Foreign Value for Case

    I keep getting an 500 error when saving a case. The error message says that there is a bad foreign value, but I don't have any foreign fields on this screen. Whenever I select a contact however, Espo seems to want to place that contact twice in the same field.

    Any ideas on what could be happening here?

  • #2
    can you share a screenshoot
    Rabii
    Web Dev | Freelancer

    Comment


    • #3
      Originally posted by marcbeinder View Post
      I keep getting an 500 error when saving a case. The error message says that there is a bad foreign value, but I don't have any foreign fields on this screen. Whenever I select a contact however, Espo seems to want to place that contact twice in the same field.

      Any ideas on what could be happening here?
      and the logfile always should help

      Comment


      • #4
        I'm actually going to do a fresh install to troubleshoot this. This install isn't a production site yet, so I'll try that. If it still occurs, I'll post screenshots and whatever logs I can find.

        Comment


        • #5
          The fresh install did not fix the issue. I've attached a screenshot of the error. I also went to go check the server logs for the error but the log was empty. And for some reason, when linking to the contact, it places the same contact record there twice and there is nothing I can do to change that.

          Advice would be appreciated. shalmaxb rabii

          Comment


          • shalmaxb
            shalmaxb commented
            Editing a comment
            need the log from espoCRM: data->logs/most recent one

        • #6
          Sound like a bad installation or modification. You did a fresh install but already set everything up...? It no longer fresh and a field or relationship you create or add is causing this issue.

          I recommend you troubleshoot step by step slowly if Logs doesn't help and you have more time to play with it than waiting for a response from other user.

          What I mean is like so when I self-troubleshoot: try adding a few field/relationship. Clear cache, rebuild, refresh browser/open new incognito, test it. Hope still work. Then keep going till, "Hey it getting this error", I added 2 field just now, let delete 1 and see.

          Comment


          • #7
            Yes I did do a fresh install and discovered this error. Because it wasn't a production site yet, I deleted everything and started over. Still ran into the error. Turns out cases have a "Contact" and a "Contacts" field. The default was to have the "Contacts" field on the case screen and that is when the error occurs. When I replaced that field on the screen with the "Contact" field the error does not occur.

            Comment


            • esforim
              esforim commented
              Editing a comment
              Solution found? I guess you just have to name it something else. Certain name or words is restricted.

          • #8
            esforim Sorta, A workaround solution was found. The weird this is that I didn't create this particular link field. It was included by default. Changing the "Contact" field will add the new field value to the "Contacts" field but not replace the contacts linked. In order to remove a contact from the case, I need to go to the contact record an manually unlink from there.

            Comment


            • #9
              i have just tested this on a new installation instance and everything works fine no error is triggered. contact is just a link to primary contact on contacts links, one thing i know if that by default you can't add both contact and contacts into the detail layout. but this shouldn't trigger any error it is been there for long time and never caused any issue. you need to check your database it might be issue with the database table.
              Rabii
              Web Dev | Freelancer

              Comment

              Working...
              X