I’m using SuiteCRM 7.11.15, about “Adding A Dropdown Field” https://docs.suitecrm.com/admin/administration-panel/studio/#_adding_a_dropdown_field i read “Item Name: Used to refer to the dropdown item in the code, this must be alphanumeric, begin with a letter and contain no spaces.”
Since I have many values that should be written with the space like “Press review” as Item Name, from Studio it’s not really possible, but if I made a change by hand would it be a problem? Do you advise against doing this?
The worst thing is when I need to import data I can’t simply write “Press review”, but I need to use for example the “Press_review” technique.
What do you think?
You can add dropdown options manually.
- create a dropdown field and add empty dropdown list.
- Add value manually in file custom/include/language/en_us.lang.php
You will have empty option for the created dropdown list. Add key and value into that array.
and you are done!
So you confirm that without using Studio, I can manually edit custom/include/language/en_us.lang.php by entering “Press review” with space as an Item Key without SuiteCRM becoming destabilized?
Because spaces into Item Key are not allowed in Studio and I’m afraid that problems with manual editing will appear.
Yes, spaces are not allowed via studio. So you need to manually add in en_us.lang.php
Which will not create any problem.
What exactly is the problem of not using spaces in item keys? These are just for internal consumption by PHP. You can use spaces in Item names, which is what is shown to users.
The problem is that when you need to import data you have to put Press_review and when you export it appears Press_review (Item Key) NOT Label!
Do you have any other solution?
Do you advise against using spaces?
I personally don’t advise anything regarding this , but that UI help message seems to recommend not using it, which makes me suspicious there’s probably a reason for it.
If there are problems with imports, they can be solved with some automatism, and that thing you mention about the export, are we talking about a bug? It changes the value in exports?
Just the fact that in import I have to put “Press_review” and not simply “Press review”, is a limitation.
In export appears “Press_review” as Item Name and not the Item Label, this is also a limitation.
I see what you mean. The code would have to be adjusted to work like you want. The problem is that sometimes people will want one thing (keys that they can later re-import) sometimes another (values to display in reports to users etc)
I guess you can always try the above suggestion from @sagarjaydeep and put the spaces in the keys. just be sure to test thoroughly to see if there are any pitfalls.