- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2024 04:16 AM
I have a strange behaviour when trying to create a record: everything seems to work fine but the record is not actually created, though insert() method returns a sys id. How can I find what's happening?
This is the code
var taskGr = new GlideRecord('wm_task');
taskGr.initialize();
taskGr.u_snj_mandatory_task = false;
taskGr.short_description = taskDescription;
taskGr.u_snj_request_type = requestType;
taskGr.parent = woSysId;
taskGr.state = 1;
taskGr.substate = 10;
taskGr.u_snj_model_requested = woModel;
taskGr.u_snj_stockroom = woStockroom;
taskGr.assigned_to = woAssignTo;
taskGr.assignment_group = woAssignmentGroup;
var insertedId = taskGr.insert();
I show insertedId on a UI message and it does have a value, but there are no records on the table
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 01:10 AM
Hi,
most likely there is some business rule or acl that prevents you from creating/inserting a record in the table. So check those table configurations.
initialize or using a .do reserves a sysid + recordnumber... but when you abort the action nothing is created.
Hopefully this gives you some guidons.
Kind regards,
Collin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 01:10 AM
Hi,
most likely there is some business rule or acl that prevents you from creating/inserting a record in the table. So check those table configurations.
initialize or using a .do reserves a sysid + recordnumber... but when you abort the action nothing is created.
Hopefully this gives you some guidons.
Kind regards,
Collin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 01:16 AM
Hi Collin,
thanks for your answer. As you may guess I am quite newbie to ServiceNow. I actually thought something about that, and I see that there are many BR's on that table. I wonder if either an 'after' BR is able to abort record insertion, or if a 'before' one is needed for that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 01:18 AM
Hi Collin,
thanks for your answer. As you may guess, I'm quite a newbie to ServiceNow. I actually thought something like that, and I see that many BR's are present on that table. I am wondering if either an 'after' BR is able to abort record insertion, or if a 'before' one is needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 01:20 AM
Hi Collin,
thanks for your answer. As you may guess I am quite a newbie to ServiceNow. I actually thought something like that, and I see many BR's are present on that table. I am wondering if either an 'after' BR is able to abort record insertion, or if a 'before' one is needed.