Invalid 'Choice' record even though the selected outside Table 'Case' is allowed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2021 07:12 AM
Hi All,
I'm getting below error when i am trying to insert choice value through the business rule. The BR is in Global scope.
Error: Invalid 'Choice' record even though the selected outside Table 'Case' is allowed
Script:
var gr2 = new GlideRecord('sys_choice');
gr2.initialize();
gr2.name = 'sn_customerservice_case';
gr2.language = 'en';
gr2.element = 'resolution_code';
gr2.label = 'Value1';
gr2.value = 'value1';
gr2.insert();
-------------------------------------------------------------------------------------
how to resolve this, suggestions please....
Thank You.
- Labels:
-
Scripting and Coding
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2021 07:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2021 09:52 AM
i Hope you did it through background scripts, can you try using business rules.
Use case is that as a agent i want to maintain the drop down values on case form.
I have created a custom table and it can be accessible for Group A.
As on when user insert a record in custom table, i want to create the choice value on case form.
Custom table contains same fields which are there on case form.
Thank You.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2021 09:32 PM
Didn't try that.
Should work from there as well.
Can you try to create choice for incident etc table and check
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
04-29-2021 11:48 PM
Hi Ankur,
For Incident, Problem, Knowledge etc, it will work for sure through the BR, for case it is not working.
Can you please try to execute same script via BR and see the behavior.
By default all the users will be in Global scope after successful login, We are trying to insert the choice value for Case table which is in Customer scope.
We are trying to create choice value for Case table i.e trying to create choice values for cross scope tables.
Thank You,
Ganesh.