Hi All
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2024 12:22 AM
I Have one question Related to User table.
Whenever add new user In User table automatic Raised Request .
Please suggest & Provided code
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2024 12:44 AM
@basha shaik Create a Business Rule will run after insert on the sys_user table. It will create a new record in the Request (sc_request) table and populate fields such as short_description and requested_for.
(function executeRule(current, previous /*null when async*/) {
var requestGr = new GlideRecord('sc_request');
requestGr.initialize();
requestGr.short_description = 'New User Request for ' + current.name;
requestGr.requested_for = current.sys_id;
requestGr.insert();
gs.addInfoMessage('Request created for new user: ' + current.name);
})(current, previous);
…………………………………………........................................................................................
Please Mark it helpful 👍and Accept Solution ✅!! If this helps you to understand.
…………………………………………........................................................................................
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2024 12:46 AM
Please describe what your use case is? What kind of request needs to be raised when? It sounds like a simple 'on insert' flow to create a record, but the way your question is formulated leaves for a lot of different explanations.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2024 01:09 AM
Hi there,
Please suggest? Please share first a bit more yourself 🙂 This is not a code factory, dump your requirement, fix it for free.
Put some effort in yourself. That also learns you a lot more than just copy/pasting. And move on... code, why? For such a basic thing: Flow designer, few minutes work, done.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field