Help with relationships

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • luigiurrea
    Junior Member
    • Dec 2022
    • 5

    Help with relationships

    Hi, new to EspoCRM, really a good system, but a lot of learning curve to do! I'm having an issue with a relationship. I'm using the software to handle a small insurance company policies, problem is that I can't figure out how to display a policy number properly. I did a varchar custom field called Policy Number (inside Policies entity), but when trying to display that under the contact details pane, I can only do a relationship to Policies (inside Contact entity), not to that specific field, and then the Policy number shows in a weird format (maybe hexadecimal), but if I click on that weird number, under contact details the number shows in the correct format. How can I fix that? I'm attaching several images to try to be clear on the problem I have. Thank you in advance for your help!
    Attached Files
  • rabii
    Active Community Member
    • Jun 2016
    • 1250

    #2
    it seems that you have not set a name for the policy hence why the it shows the id. you need to set the name of the policy.
    Rabii
    Web Dev

    Comment

    • item
      Active Community Member
      • Mar 2017
      • 1476

      #3
      Hi,
      as rabii say
      i can add :

      you can set "name" by formula and concat some other field.


      If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

      Comment

      • luigiurrea
        Junior Member
        • Dec 2022
        • 5

        #4
        Hi, thank you for your response, but I can't figure it out how to apply your advice, maybe you have a guide to a video where this is explained? I already checked all the tutorials on Youtube, with no luck!

        Comment

        • rabii
          Active Community Member
          • Jun 2016
          • 1250

          #5
          go to Administration > Entity Manager > Policy > Formula and past this code:

          Code:
          ifThen(entity\isNew() || !entity\attribute('name') || entity\isAttributeChanged('policyNumber'),
               name = entity\attribute('policyNumber')
          );​​
          This code will be executed and will set the policy name to whatever value the policyNumber has. this way on the contact the policy will show the name instead of the ID.
          Rabii
          Web Dev

          Comment

          • esforim
            Active Community Member
            • Jan 2020
            • 2204

            #6
            I recommend you dig to find where the issue start and 'end'. Here is my guide to 'debugging'

            Hi there, I just installed espo on my aws server and spent all day setting it up. Email is working fine however importation of my data is not working correctly. I have been using a commercial crm for the past 6 years and have downloaded the data in csv files. It is really strange because Sometimes it imports some of the leads

            Comment

            Working...