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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2018 09:34 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2018 03:16 AM
Thanks shishir for the quick response and solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2018 03:10 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2018 03:15 AM
Thanks I will do that
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2022 06:25 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2022 03:15 AM
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