Announcement

Collapse
No announcement yet.

Multiple Field copy/autopopulate & concatenate

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

  • Multiple Field copy/autopopulate & concatenate

    I am trying to create a "File Name" field which basically consist of the File ID & the Name field together.

    Based on the Property extensions it only use "Address" and the Name field is Read Only mode but it read the "Street Name" & "City" and populate that date. I have a look at the Formula (also Options and Default value) but none of that there. So I'm don't know how I can do this.

    Basically want something like this but for any field I want.

    First Name: John
    Last Name: Smith
    AddressCity: City1

    Combine Field (read only): John Smith - City1

    Currently EspoCRM already do these combine field such as Full Address, Full Name, etc. But all these code is hard coded. There is no visible setting shown when you use Entity Manager so it hard to replicate.

  • #2
    In espocrm there is a simple(but hard code needed) way to do that,

    In the entityDefs > YourEntity.json > fields > yourField

    you can add the select property, where you can write any sql you want, so you can use the concat or any other function

    I think it is not possible to make everything done from the front-end, we need to code sometimes

    Note: in these cases using "notStorable": true makes sense

    example of this way
    "duration": {
    "type": "duration",
    "start": "dateStart",
    "end": "dateEnd",
    "options": [900, 1800, 3600, 7200, 10800, 86400],
    "default": 3600,
    "notStorable": true,
    "select": "TIMESTAMPDIFF(SECOND, meeting.date_start, meeting.date_end)",
    "orderBy": "duration {direction}"
    },

    Comment


    • #3
      Thank you. Perhaps using formula might be an alternative then, worse case I need to learn some basic coding.

      Comment

    Working...
    X