diff --git a/GlideRecord/Populate the type of device on any record/Readme.md b/GlideRecord/Populate the type of device on any record/Readme.md new file mode 100644 index 0000000000..8f3f70e697 --- /dev/null +++ b/GlideRecord/Populate the type of device on any record/Readme.md @@ -0,0 +1 @@ +This script will return and populate the type of device from which incident or issue is raised. diff --git a/GlideRecord/Populate the type of device on any record/typeOfDevice.js b/GlideRecord/Populate the type of device on any record/typeOfDevice.js new file mode 100644 index 0000000000..8a91c4fcaa --- /dev/null +++ b/GlideRecord/Populate the type of device on any record/typeOfDevice.js @@ -0,0 +1,16 @@ +// Business rule that runs Before Insert on any record to get the type of device the user is raising the incidents or issues +(function executeRule(current, previous /*null when async*/ ) { + + // Add your code here + var device = GlideMobileExtensions.getDeviceType(); + + if (device == 'doctype') + { + current.u_type_of_device = 'Laptop / Desktop'; // I have added my custom field, it can be added for the required field + } + if (device == 'm') + { + current.u_type_of_device = 'Mobile'; // I have added my custom field, it can be added for the required field + } + +})(current, previous);