Schlagwörter: Add new column, CustomerCompany, Dynamic Field
-
AutorBeiträge
-
-
15. November 2020 um 19:22 Uhr - Views: 1155 #10032
I have some problems with the dynamic field feature on customer companies. For example i would like to add a new dynamic field called “customer_internal_id” to the customer company informations. Unfortunately i don’t find any option to add this dynamic field to the customer company informations. I already did some research on the internet and read several times that this isn´t possible anymore.
Can someone tell me how to do it or what i am doing wrong?
-
16. November 2020 um 10:25 Uhr #10035
Hi Syoxx,
That’s not true, I’m sure it’s possible. ;)
You need to add the dynamic field info to the $Self->{CustomerCompany} mapping in Kernel/Config.pm. If this option does not already exist in Kernel/Config.pm, you need copy the entire option from Kernel/Config/Defaults.pm to Kernel/Config.pm:
$Self->{CustomerCompany} = {
Name => Translatable(‘Database Backend’),
Module => ‘Kernel::System::CustomerCompany::DB’,
.. More Content …
Map => [
# Info about dynamic fields:
#
# Dynamic Fields of type CustomerCompany can be used within the mapping (see example below).
# The given storage (third column) then can also be used within the following configurations (see above):
# CustomerCompanySearchFields, CustomerCompanyListFields
#
# Note that the columns ‘frontend’ and ‘readonly’ will be ignored for dynamic fields.
# var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly
[ ‘CustomerID’, ‘CustomerID’, ‘customer_id’, 0, 1, ‘var’, ”, 0 ],
[ ‘CustomerCompanyName’, ‘Customer’, ‘name’, 1, 1, ‘var’, ”, 0 ],
[ ‘CustomerCompanyStreet’, ‘Street’, ‘street’, 1, 0, ‘var’, ”, 0 ],
[ ‘CustomerCompanyZIP’, ‘Zip’, ‘zip’, 1, 0, ‘var’, ”, 0 ],
[ ‘CustomerCompanyCity’, ‘City’, ‘city’, 1, 0, ‘var’, ”, 0 ],
[ ‘CustomerCompanyCountry’, ‘Country’, ‘country’, 1, 0, ‘var’, ”, 0 ],
[ ‘CustomerCompanyURL’, ‘URL’, ‘url’, 1, 0, ‘var’, ‘[% Data.CustomerCompanyURL | html %]’, 0 ],
[ ‘CustomerCompanyComment’, ‘Comment’, ‘comments’, 1, 0, ‘var’, ”, 0 ],
[ ‘ValidID’, ‘Valid’, ‘valid_id’, 0, 1, ‘int’, ”, 0 ],
# Dynamic field example
# [ ‘DynamicField_Name_Y’, undef, ‘Name_Y’, 0, 0, ‘dynamic_field’, undef, 0 ],
],
};
After that you are able to configure your dynamic fields. Please add the following information to the mapping for each field:
[ ‘DynamicField_Name_Y’, undef, ‘Name_Y’, 0, 0, ‘dynamic_field’, undef, 0 ],
Another possibility is to extend the database table and don’t use a dynamic field:
For MySQL or MariaDB:
root> mysql -uroot otrs
root> ALTER TABLE customercompany add NameOfNewColumn VARCHAR(255);
After that add a new value to the mapping above:
[ ‘CustomerCompanyNameOfNewColumn’, ‘LabelOfNewColumn’, ‘NameOfNewColumn’, 1, 0, ‘var’, ”, 0 ],
I hope I could help. Please do not hesitate to contact us if you have any questions.
Best regards from Germany,
Stefan
Team OTOBO
-
16. November 2020 um 23:21 Uhr #10062
Hi Stefan,
thank you so much for your help! It works perfectly.
Best regards,
Syoxx -
17. November 2020 um 5:01 Uhr #10063
You’re welcome, have fun with OTOBO!
-
22. November 2020 um 18:16 Uhr #10181
Hi Stefan,
I’ve tried around with dynamic fields in the last few days but got another problem. I want to add a dropdown field to each customer where i can select the purchased products by the customer. So that I have the opportunity to search for this field and see all customers with product A oder product B.
I successfully created a new field with the type “Multiselect”. This field is shown for each customer but the dropdown menu isn´t working. I´am only able to write numbers in it (because data type is integer). Can you tell me what i’m doing wrong?
Best regards,
Syoxx
-
-
AutorBeiträge
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.