Can the Customer ID be self generated

Moderator: crythias

Locked
rohit1
Znuny newbie
Posts: 73
Joined: 19 Feb 2011, 12:05
Znuny Version: 3.0.5

Can the Customer ID be self generated

Post by rohit1 »

Hi All,

Can we put the Customer ID to be Auto generated in the Customer detail form, i.e we have to fill the info of Customer ID, can we make it as self generated as the same ticket number is generated.

Regards
Rohit Singh
Regards
Rohit Singh
OTRS 3.0.7
Platform: Windows XP, MAC OS X
DB: OTRS db
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: Can the Customer ID be self generated

Post by ferrosti »

You could setup another mapping for your customer data backend and e.g. set email as customer_id.
http://doc.otrs.org/3.0/en/html/custome ... backend-db
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
rohit1
Znuny newbie
Posts: 73
Joined: 19 Feb 2011, 12:05
Znuny Version: 3.0.5

Re: Can the Customer ID be self generated

Post by rohit1 »

Hi ferrosti,

I want to generate Customer ID automatically from the OTRS Software, not manually, in a particular format like ABCD/0001/11-12 and the next time it should generate to ABCD/0002/11-12, here 11-12 denotes the year, after completion of 2011 year, the format should change to ABCD/000199/12-13, please guide how can i achieve this, looking forward for your kind reply.
Last edited by rohit1 on 09 Jun 2011, 07:11, edited 1 time in total.
Regards
Rohit Singh
OTRS 3.0.7
Platform: Windows XP, MAC OS X
DB: OTRS db
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: Can the Customer ID be self generated

Post by ferrosti »

This is not possible by default and needs to be programmed.
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
rohit1
Znuny newbie
Posts: 73
Joined: 19 Feb 2011, 12:05
Znuny Version: 3.0.5

Re: Can the Customer ID be self generated

Post by rohit1 »

Hi,

Please guide me in programming, will be grateful to you.
Regards
Rohit Singh
OTRS 3.0.7
Platform: Windows XP, MAC OS X
DB: OTRS db
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Can the Customer ID be self generated

Post by jojo »

you have already been told to read the developer docu.
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
rohit1
Znuny newbie
Posts: 73
Joined: 19 Feb 2011, 12:05
Znuny Version: 3.0.5

Re: Can the Customer ID be self generated

Post by rohit1 »

Hi,

I read the Developer docs, but there not any hint to auto generate the Customer ID, please guide anyone.
Regards
Rohit Singh
OTRS 3.0.7
Platform: Windows XP, MAC OS X
DB: OTRS db
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Can the Customer ID be self generated

Post by jojo »

there is no hint as you need to develop these kind of functionality.

You'll need some deep insight on Perl development and OTRS Moduling. So read the docu and the code to learn and understand.
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
rohit1
Znuny newbie
Posts: 73
Joined: 19 Feb 2011, 12:05
Znuny Version: 3.0.5

Re: Can the Customer ID be self generated

Post by rohit1 »

ok, thnx :(
Regards
Rohit Singh
OTRS 3.0.7
Platform: Windows XP, MAC OS X
DB: OTRS db
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Can the Customer ID be self generated

Post by crythias »

rohit1 wrote:Hi ferrosti,

I want to generate Customer ID automatically from the OTRS Software, not manually, in a particular format like ABCD/0001/11-12 and the next time it should generate to ABCD/0002/11-12, here 11-12 denotes the year, after completion of 2011 year, the format should change to ABCD/000199/12-13, please guide how can i achieve this, looking forward for your kind reply.
Normally, I'd say use javascript, but since you have to remember and auto-increment, your needs exceed that.
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
rohit1
Znuny newbie
Posts: 73
Joined: 19 Feb 2011, 12:05
Znuny Version: 3.0.5

Re: Can the Customer ID be self generated

Post by rohit1 »

hi crythias,

please provide java script code, i will test if it works.
Regards
Rohit Singh
OTRS 3.0.7
Platform: Windows XP, MAC OS X
DB: OTRS db
rohit1
Znuny newbie
Posts: 73
Joined: 19 Feb 2011, 12:05
Znuny Version: 3.0.5

Re: Can the Customer ID be self generated

Post by rohit1 »

Hi Crythias,

I added the below javascript code, but still not working, please suggest.


<script type="text/javascript">
function changeText(){
var A1 ='ABCi';
var lastid = '9'; // fetch this last value from database
var lastidInt = 9;
var cuntid = lastid.length;
//alert(cuntid);
if(cuntid == 1 && lastidInt < 9)
{
var noofzero = '000';
}
else if(cuntid == 1 && lastidInt == 9)
{
var noofzero = '00';
}
else if(cuntid == 2 && lastidInt < 99)
{
var noofzero = '00';
}
else if(cuntid == 2 && lastidInt == 99)
{
var noofzero = '0';
}
else if(cuntid == 3 && lastidInt < 999)
{
var noofzero = '0';
}
else if(cuntid == 3 && lastidInt == 999)
{
var noofzero = '';
}
else
{
var noofzero ='';
}
//alert(noofzero);

var id = lastidInt + 1;

var year = 2011;
document.getElementById('custid').value = A1 + '/' + noofzero + id + '/' + year ;
}

window.onload = function() {
changeText();
};
</script>

<input type='input' id='custid' value='' readonly="readonly"/>
Regards
Rohit Singh
OTRS 3.0.7
Platform: Windows XP, MAC OS X
DB: OTRS db
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Can the Customer ID be self generated

Post by crythias »

Please edit your signature to include your OTRS version, Operating System, and database type.

Please indicate where your user list is obtained(otrs db? ldap?)

What you're asking is so far outside the scope of OTRS, I won't offer help on it for free.
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
rohit1
Znuny newbie
Posts: 73
Joined: 19 Feb 2011, 12:05
Znuny Version: 3.0.5

Re: Can the Customer ID be self generated

Post by rohit1 »

Hi,

The details are as below:

OTRS version - 3.0.7, Operating System - Windows XP , database type - MYSQL.

Please indicate where your user list is obtained - OTRS db
Regards
Rohit Singh
OTRS 3.0.7
Platform: Windows XP, MAC OS X
DB: OTRS db
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: Can the Customer ID be self generated

Post by ferrosti »

Fetch the last 'id' from customer_user, create a var filled with '000', append the id, remove leading zeros, check for <999, return.
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
Locked