How to create system property that simplifies code and use in Business rule?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 09:38 PM
Hi all,
Actually in time sheet we have tasks , to display those tasks we have to mention tables in the below
once we added our required table here , it will display on the tasks list ,once it is available , there is one custom BR is there checking here also
now the concern was like whenever we want another task to task list in time sheet we need to change these two places
so now i want to create one system property that combines these two things and need to used in , because of that instead of changing two places , simply we can update system property
Please help me to achieve this
Thanks
Deepika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 12:28 AM
Hi @Deepika61 ,
1. Create a System Property first by navigating to "sys_properties.LIST".
Within your Widget, define a variable on the top of Server Side component of the widget as below:
data.getProp = gs.getProperty('Property Name');
Then update the line in your widget screenshot as below:
"tables":data.prop,
Now, update your business rule as below:
var prop = gs.getProperty('property name');
if(!gr.next() && prop.indexOf(current.task.sys_class_name)>-1){
current.setAbortAction(true);
}
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 01:03 AM
Thanks for the response
Actually its an instance which was in first screenshot
and what i need to mentioned in the value for the property?
and in the BR we have moved the condition to in condition field like this
Then how we use the property for this BR?
Thanks
Deepika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 01:08 AM
in new system property add those 2 tables as comma separated value
please share the BR code
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2024 01:20 AM - edited 01-11-2024 01:25 AM