how to add a prefix in incident number field according to the domain

geetika20
Mega Contributor

Hi,

I want to add a prefix in incident number field according to the domains . For ex- if my domain is ABC then if I raise a incident the prefix should be like: ABC-INC-00000(number).

Can anyone suggest how to do this.

10 REPLIES 10

Thanks shishir for the quick response and solution


Munender Singh
Mega Sage

Hi Geetika,



Apologies as I was not able to understand your question properly,Kindly proceed with the below steps and note that I have not tested them on instance so,there could be some error.


You can use the following code:



1.Create a new 'Display' Business rule on incident table but in global domain.



//BR for popping the prefix



putDomainVariable();



function putDomainVariable()


{


var domainname = current.sys_domain.name;


current.number = domainname + '-' + current.number;


}



2.As the number field is read only,so you have to perform two more steps:


       


        2.1.Create a new ACL for incident table and make it editable for ITIL role.



      2.2.Go to the Data dictionary and check the 'Read only' box for the 'number' field




**If you want me to create an ACL that I can do but it is very easy,first try out with this logic and if any problem please revert to me



Regards,


Munender



**PS: Your feedback (Like, Helpful or Correct) helps community


Thanks I will do that


Hi, 

I have a similar question maybe you are able to support me. 

We have many domains but on two specific Domains I need to change the prefix of the assessment number. 

For Example:
Table: asmt_assessment_instance
OOB Prefix = AINST

Required Change:

On Domain 1: Prefix = ABA
On Domain 2: Prefix = SB

Do you have any idea how manage this? 

Best regards

Josef

 

Hello Jos,

Sorry for late response as I was away for a while! 

 

For your requirement you need to modify the Business Rule , I have shared it below. Please see if it helps:

 

1.Create a new 'Display' Business rule on incident table but in global domain.

//BR for popping the prefix

 

putDomainVariable();

function putDomainVariable()

{

var domainName = current.sys_domain.name;

 

if(domainName = "Domain 1")

current.number = "ABA" + '-' + current.number;

}

else if(domainName = "Domain 2")

current.number = "SB" + '-' + current.number;

}

 

2.As the number field is read only,so you have to perform two more steps:

  2.1.Create a new ACL for incident table and make it editable for ITIL role.

  2.2.Go to the Data dictionary and check the 'Read only' box for the 'number' field

 

Regards,

Munender