diff --git a/Server-Side Components/Script Includes/Delete Swipe Function/README.md b/Server-Side Components/Script Includes/Delete Swipe Function/README.md new file mode 100644 index 0000000000..33e8dfc384 --- /dev/null +++ b/Server-Side Components/Script Includes/Delete Swipe Function/README.md @@ -0,0 +1,12 @@ +Delete Swipe Function + +1. This Delete Swipe Function was present in Now Mobile - Mobile App Builder (MAB) +2. Create a Script Include name as incidentDeleteUtils +3. Make Accessible from - All application scopes +4. Create a deleteIncident function +5. Pass the sys_id as a input parameter +6. Glide Incident table for checking the record +7. Use if logic for cecking the record is present or not with provided sys_id +8. If found delete the Incident record then return as "Incident Deleted Successfully" +9. If not fount return as "Incident Not Found" +10. This functionality will work in the Now Mobile App & Mobile App Builder (MAB). diff --git a/Server-Side Components/Script Includes/Delete Swipe Function/incidentDeleteUtils.js b/Server-Side Components/Script Includes/Delete Swipe Function/incidentDeleteUtils.js new file mode 100644 index 0000000000..8f2c67e097 --- /dev/null +++ b/Server-Side Components/Script Includes/Delete Swipe Function/incidentDeleteUtils.js @@ -0,0 +1,15 @@ +var IncidentDeleteUtils = Class.create(); +IncidentDeleteUtils.prototype = { + initialize: function() {}, + + deleteIncident: function(sys_id){ + var gr = new GlideRecord('incident'); + if(gr.get(sys_id)){ + gr.deleteRecord(); + return "Incident Deleted Successfully"; + } + return "Incident Not Found"; + }, + + type: 'IncidentDeleteUtils' +};