How to add fields to the devices table?

kevcar918 years ago

Greetings,

I'm trying to add two fields to the device table (companyId, deparmentId), but when I save a device via api I mark this error:

Unrecognized field "companyId" (class org.traccar.model.Device), not marked as ignorable (13 known properties: "contact" (truncated...)

My question will be what do I have to modify so that I can recognize the fields that I added when saving?

It is worth mentioning that you would need to make the same modifications for the groups and geofences tables

Anton Tananaev8 years ago

I guess you haven't added new fields somewhere. Look at existing fields and make sure you do the same for your new ones.

kevcar918 years ago

I have already added the CompanyId and DeparmentId fields to the device table, the problem occurs when I send the parameters through the API, if I delete these fields if I save the device without any problem.

That's why I asked if I should make any changes to the traccar engine to recognize the fields I added

Malkit Singh8 years ago

did you modify insert query in the config file?

kevcar918 years ago

I have not modified anything in the engine of (I do not know which file to modify), it is justamento that I would like to know which file I modify and modify in said file

Anton Tananaev8 years ago

If you need help with customization, send me an email to discuss it.

kevcar918 years ago

Okay, could you give me the email address

Anton Tananaev8 years ago

You can find it at the bottom of this page (envelope icon).

Tjibbe Spoelstra6 years ago

I have the same problem. Edit the Java and JS and columns. I know I have to declare it somewhere else but where? I did it in the "model/user.java" and made my new field look the same as "administrator" also mvn package work fine

I also added it like to the "dialog/User.js" and the "dialog/UserController.js" also in "edit/Users.js", and "edit/UsersController.js"

Peter Flower6 years ago

Hi Tjibbe Spoelstra, do you have email or Skype?

Best Regards

Tjibbe Spoelstra6 years ago

Hi Peter, yes I do. Feel free to email me at tjibbe@protonmail.com. I documented each change I made I can email you the document. It has each file that I changed with the code added in the file. Please email me then we can discuss it