Text field not allowing space or dot

Ashutosh Pandey asked on December 11, 2018 13:38

I am working with modules and classes. I created class Company and added some fields like CompanyName, Description etc. I am trying to upload data using Excel. I am getting following

The object code name '' is not valid. The code name can contain only alphanumeric characters, some special characters (_, -, .) and cannot start or end with '.'.

I did not select "Display name column" and "Code name column" in the Code tab. Are they necessary? Do I have to add field "CompanyDisplayName" and select it for "Display name column" and "Code name column"? What will be the value for this field if I need to add it? Please help, thanks

Thanks

Correct Answer

Suneel Jhangiani answered on December 11, 2018 23:13

Whilst a CodeName or DisplayName field are not required it can be advantageous to have these since Kentico will then take care of additional functionality. In your case you should consider CompanyName for the display name, however, you probably would not need a codename.

The error you are getting indicates that the object is configured with a code name. On the code tab confirm that the code name field shows '(none)', then click the Generate Code button. After that copy and paste the code for the Info and Provider classes to the relevant files in your application (varies depending on whether it is a web app project or a web site project).

I would also suggest you read the docs on developing custom modules and in particular the section on configuring the Info class so that you understand how they should be configured (note: in particular the code generation does not include any Parent object type or parent id which needs to be manually added).

0 votesVote for this answer Unmark Correct answer

Recent Answers


Ashutosh Pandey answered on December 12, 2018 04:43

Thanks a lot Suneel,

I fixed it with following settings:

Display name column: CompanyName Code name column: (none)

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.