setAbortAction is not working in Scoped application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2021 11:27 PM
Hi,
I am currently on a Human Resource Core scope and on the Record producer General inquiry i have an option as Type of issue and if the selects the type of issue as Issue then i need to stop the creation of hr case..
In the Record producer i written script like below.
new sn_hr_core.hr_ServicesUtil(current, gs).createCaseFromProducer(producer, cat_item.sys_id);
if(producer.type_of_issue == 'issue')
{
current.setAbortAction(true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2021 03:48 AM
then create BR in global scope for that HR table and abort the transaction
If you are not able to select the table in global scope then ensure allow configuration checkbox is checked at table level
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2021 10:47 PM
since i do not have any other option i can go with BR on HR Table but i would like to understand can i differentiate saying this should abort only when the record is created from a Record producer.
Is there a way to categorize this ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2021 11:07 PM
Hi,
you can check if record is present in this table
sc_item_produced_record
But I doubt if record gets created in that before insert
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2021 10:54 PM
Hi
go to the table definition and look in the Application Access section to ensure it has something like this: Accessible from all application scopes and other parameters as shown below.
Regards,
Gunjan
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2021 11:23 PM