Creating new dropdown field at Customer Portal

English! place to talk about OTRS development, programming and coding
Post Reply
samerelk
OTRS newbie
Posts: 1
Joined: 21 Aug 2019, 07:42
OTRS Version?: 5.0.10
Real Name: Samer
Company: Crystal Networks

Creating new dropdown field at Customer Portal

Post by samerelk » 22 Aug 2019, 14:03

Hello all,

I am new to OTRS.
My version is 5.0.10 installed on a Linux server.
I am trying to add a new dropdown field from the OTRS database where I created a new table to select from it.

I tried to follow the same flow used to select ticket types, as follow:
1. I created a new Perl module (GetProducts.pm) in /Kernel/System where a sub does a select from database using DB Object and returning back hash variable.
2. I edited CustomerTicketMessage.pm where I called my Perl module (GetProduct.pm) and passed my hash variable to BuildSelection function to create HTML options.
3. I edited CustomerTicketMessage.tt where I added a new text dynamic field and passed the variable from the Perl module ([% Data.ProductStrg %])

When I test the result, I can see the dropdown field but always empty.
Any suggestions on how to debug my modules by following my subroutines?
Or any suggestions on how to create this dropdown field in an easier way?

Thanks in advance!

root
Moderator
Posts: 1758
Joined: 18 Dec 2007, 12:23
OTRS Version?: 4/5/6
Real Name: Roy Kaldung
Company: Znuny Inc.
Contact:

Re: Creating new dropdown field at Customer Portal

Post by root » 22 Aug 2019, 15:27

Hi,

Did you ever think about not reinventing the wheel? There are several modules available which populate drop-down fields with data from database tables. Some of them can also be obtained without having a support contract. Just check the typical resources for feature add-ons. Will save you time and nerves. Or take a developer training.

To help you with such a task here at the forum, the related source code will definitely help ;-)

- Roy
OTRS 4/5/6 CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

You need professional services? Check out https://www.znuny.com/

Post Reply