Announcement

Collapse
No announcement yet.

Change Entity Name Field Type

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

  • Change Entity Name Field Type

    Hello,

    I have been using EspoCRM for a few months now and absolutely love it! Thank you for an outstanding product and we will soon be purchasing the addons.

    I do have a question regarding the name field for entity. I have created some custom entities but the name field shouldn't be manually entered. I was hoping to make it a number field with a prefix and having the system automatically assign this. I created new fields to do this job, but linking records to other entities results in showing "null" vs. what im looking to display. Is there an easy way to change the name field?

    Thanks!

  • #2
    you can not change dirrectly datatype of Name field of an entity. However, there is a simple solution you can use
    create a new field number with auto increment
    under entiy manager, a list of entities, over the right side of the enity there is an arrow drop down menu with formula and remove option if it is a custom one
    choose formla and then entersomething similar to this
    name = identifiant;
    where identifiant is the field with auto increment, on every save of this new entity, the name field is going to have idetifiant content
    you can referer to this link for general explanation how to use formula

    Comment


    • #3
      Hi,

      You can change a field type manually.

      Create the file custom/Espo/Custom/Resources/metadata/entityDefs/YourEntityType.php


      Code:
      {
           "fields": {
                "name": {
                       "type": "number"
                }
            }
      }
      "name" is a name of Name field.
      Last edited by yuri; 07-04-2018, 05:57 PM.

      Comment


      • #4
        Originally posted by yurikuzn View Post
        Hi,

        You can change a field type manually.

        Create the file custom/Espo/Custom/Resources/metadata/entityDefs/YourEntityType.php


        Code:
        {
        "fields": {
        "name": {
        "type": "number"
        }
        }
        }
        "name" is a name of Name field.
        yuri Will this work with the new Attachment Multiple - Lets say that I currently have a File type field with sustancial records but now I'd like to transform that field into the new Attachement Multiple without losing any prior data - Please advise - thanks

        Comment

        Working...
        X