External customer database

Moderator: crythias

Locked
ndhvu275
Znuny advanced
Posts: 139
Joined: 06 Nov 2012, 09:02
Znuny Version: 3.x, 4.x and 5.x
Real Name: Vu Nguyen
Company: INFOdation
Location: Netherlands
Contact:

External customer database

Post by ndhvu275 »

Dear all,

Using External customer database

I configured to connect to external database already. That's very nice. But now I'm facing how to mapping one field (OTRS) to many fields (external DB)? Let see below is mycase:

In OTRS I have CustomerID field, then want to map with 3 field from ext DB (postcode + house number + ext house number). It means:
CustomerID = postcode + house number + ext house number

are there anyway to map field as above? or anyway same above idea? Please help me

Thanks a lot

Hoang Vu
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: External customer database

Post by reneeb »

You could create a view on the external database and use this view as the external table. In that view you can do something like

Code: Select all

"CREATE VIEW otrscustomers AS SELECT CONCAT(postcode, house, ext_hous) AS customer_id ..."
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: External customer database

Post by crythias »

If not ... you could, in theory, provide the concatenation method as the field.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
ndhvu275
Znuny advanced
Posts: 139
Joined: 06 Nov 2012, 09:02
Znuny Version: 3.x, 4.x and 5.x
Real Name: Vu Nguyen
Company: INFOdation
Location: Netherlands
Contact:

Re: External customer database

Post by ndhvu275 »

reneeb wrote:You could create a view on the external database and use this view as the external table. In that view you can do something like

Code: Select all

"CREATE VIEW otrscustomers AS SELECT CONCAT(postcode, house, ext_hous) AS customer_id ..."
Hi reneeb, this is really a good solution.

Thank you very much

Hoang Vu
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
ndhvu275
Znuny advanced
Posts: 139
Joined: 06 Nov 2012, 09:02
Znuny Version: 3.x, 4.x and 5.x
Real Name: Vu Nguyen
Company: INFOdation
Location: Netherlands
Contact:

Re: External customer database

Post by ndhvu275 »

crythias wrote:If not ... you could, in theory, provide the concatenation method as the field.
Hi crythias,

Please give an example for using concatenation method, I also need to know your solution insteed of my customers do not allow to create a view on their DB.
For example in Map field method in config.pm

Code: Select all

[ 'UserCustomerID', 'CustomerID', 'zip', 0, 1, 'var', '', 0 ],
How to write the coding to merge zip, house_no and house_ext_no

I also need to your help to explain more abt coding in another thread: viewtopic.php?f=62&t=7750

Thanks in adv

Hoang Vu
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: External customer database

Post by crythias »

read reneeb's post for a concatenate method for MySQL.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
ndhvu275
Znuny advanced
Posts: 139
Joined: 06 Nov 2012, 09:02
Znuny Version: 3.x, 4.x and 5.x
Real Name: Vu Nguyen
Company: INFOdation
Location: Netherlands
Contact:

Re: External customer database

Post by ndhvu275 »

crythias wrote:read reneeb's post for a concatenate method for MySQL.
Ah, I think your idea is use concatenate method in perl

Anyway thank

Hoang Vu
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: External customer database

Post by crythias »

Code: Select all

[ 'UserCustomerID', 'CustomerID', 'CONCAT(postcode, house, ext_hous)', 0, 1, 'var', '', 0 ],
There's no inherent reason the read portion of the code can't do this.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
ndhvu275
Znuny advanced
Posts: 139
Joined: 06 Nov 2012, 09:02
Znuny Version: 3.x, 4.x and 5.x
Real Name: Vu Nguyen
Company: INFOdation
Location: Netherlands
Contact:

Re: External customer database

Post by ndhvu275 »

crythias wrote:

Code: Select all

[ 'UserCustomerID', 'CustomerID', 'CONCAT(postcode, house, ext_hous)', 0, 1, 'var', '', 0 ],
There's no inherent reason the read portion of the code can't do this.
Many thanks. It's very nice and flexible

Vu Nguyen
OTRS 3.x, 4.x on CentOS/Windows
MySQL database
External customer backend with MySQL, MSSQL
Customization
Locked