Thursday, July 25, 2019

Reset Button or Clear Values button widget to clear catalog item variable values

Step 1: Create a widget as shown below

Body HTML Template:


<button type="button" class="btn btn-danger btn-block" ng-click="c.setFieldValue(inputValue)">Reset Values</button>


Client Controller script


function($scope) {
var c = this;
c.setFieldValue = function(uploadname) {
var g_form = $scope.page.g_form;
g_form.clearValue("acrobat");
g_form.setValue("Additional_software_requirements", "");
g_form.setValue("test","");
g_form.setValue("photoshop", "");
};
}


Step-2: Create a variable of type Macro and in the default section give this widget name.

Thursday, June 27, 2019

ServiceNow parseInt() is returning NaN all the times

This is a common issue and the resolution is to pass both the parameters to the parseInt() method. It accepts the second parameter, which is the base

var testString = "10101"
var number = parseInt(testString, 10) + 100


The second parameter indicates that this integer has to be generated in base10

-------------------------------------------------------------------------------------------------------------
Are you looking to implement custom solutions in ServiceNow?

You are at the right place. Reach us at

Conyx IT Solutions | ServiceNow experts
partners@conyxit.com