Skip to content

Commit c936119

Browse files
Populate the Device type on any record (#1452)
* Create listOfRecordsBasedOnLocation.js * Create Readme.md * Update listOfRecordsBasedOnLocation.js * Update Readme.md * Update Readme.md * Update listOfRecordsBasedOnLocation.js * Create typeOfDevice.js * Create Readme.md * Delete GlideRecord/Display list of records based on Users Location/Readme.md * Delete GlideRecord/Display list of records based on Users Location/listOfRecordsBasedOnLocation.js
1 parent f1a4499 commit c936119

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This script will return and populate the type of device from which incident or issue is raised.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Business rule that runs Before Insert on any record to get the type of device the user is raising the incidents or issues
2+
(function executeRule(current, previous /*null when async*/ ) {
3+
4+
// Add your code here
5+
var device = GlideMobileExtensions.getDeviceType();
6+
7+
if (device == 'doctype')
8+
{
9+
current.u_type_of_device = 'Laptop / Desktop'; // I have added my custom field, it can be added for the required field
10+
}
11+
if (device == 'm')
12+
{
13+
current.u_type_of_device = 'Mobile'; // I have added my custom field, it can be added for the required field
14+
}
15+
16+
})(current, previous);

0 commit comments

Comments
 (0)