- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 01:03 AM
I have written below script in Before Insert BR to Populate Correlation ID as TCSCE:{Number}. But number is not getting populated. screenshot below.
var abc = new GlideRecord("incident");
abc.initialize();
abc.correlation_id = "TCSCE:" + "{" + abc.number + "}";
abc.insert();
In output, All I am getting is as attached image below. Number is missing.
I guess it is happening, because Number value is not available for Before insert BR. But then how can I do this requirement?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 01:14 AM
You have to write after Business rule
current.correlation_id = "TCSCE:" + "{" + current.number + "}";
current.setWorkflow(false);
current.update();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 01:11 AM
Hi what is your requirement? You would need after BR here because sysid will be generated only after insert
var abc = new GlideRecord("incident");
abc.initialize();
abc.short_description = "test";
var sysID = abc.insert();
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 01:11 AM
what is abc?
If it is giving blank value, it means abc.number is empty.
How will you get the number if the record is not created yet.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 01:22 AM
well abc is gliderecord of incident table. Full script has been shared above
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2022 01:14 AM
You have to write after Business rule
current.correlation_id = "TCSCE:" + "{" + current.number + "}";
current.setWorkflow(false);
current.update();