- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2018 06:05 AM
Hello, ive a service catalog page and some items to order, once user user click on the item, it shows the error as given in the question. When i check the console the following error shows up.
(g_env) [SCRIPT:EXEC] Error while running Client Script "Initialize CSD schedule fields": ReferenceError: GwtDate is not defined
How to fix it?
The catalog client script use is :
function onLoad() {
g_form.setValue("lease_start", currentTime());
g_form.setVisible("lease_end",false);
checkSoftwareRevocable();
}
function currentTime() {
var dt = new GwtDate();
dt.now();
return dt.serializeInUserFormat();
}
function checkSoftwareRevocable() {
var ga = new GlideAjax("sn_client_sf_dist.CSDAjax");
ga.addParam("sysparm_name","getSoftwareRevocable");
var catItemId = g_form.getParameter("sysparm_id");
ga.addParam("sysparm_cat_item",catItemId);
ga.getXMLAnswer(function(answer) {
if (answer == "true")
g_form.setVisible("lease_end", true);
});
}
Solved! Go to Solution.
- Labels:
-
Request Management
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2020 04:54 AM
Sorry for the very late answer. You basically have to do the following two things:
1. Uncomment (or remove) the line g_form.setValue("lease_start", currentTime());
2. Open the lease_start variable, add the following as default value: javascript:new GlideDateTime()
Edit: There seems to be another bug:
If you're getting a TypeError: g_form.getParameter is not a function error, change the following line from
var catItemId = g_form.getParameter("sysparm_id");
to
var catItemId = g_form.getSysId();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2020 04:54 AM
Sorry for the very late answer. You basically have to do the following two things:
1. Uncomment (or remove) the line g_form.setValue("lease_start", currentTime());
2. Open the lease_start variable, add the following as default value: javascript:new GlideDateTime()
Edit: There seems to be another bug:
If you're getting a TypeError: g_form.getParameter is not a function error, change the following line from
var catItemId = g_form.getParameter("sysparm_id");
to
var catItemId = g_form.getSysId();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2018 09:31 AM
Is there a way to suppress this client error message in the short term?
We are in the process of upgrading to London and would prefer to complete the upgrade and address the client errors post upgrade.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2018 12:11 AM
Hi Thomas
When you follow my answer just before your post, you shold have a quick and easy solution.
If my solution suits for you, please mark as helpful and as solution of the thread.
Regards,
Fabian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2020 12:21 AM
Do you suggest any Workaround to get rid of this error? "There is a JavaScript error in your browser console"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2021 02:11 AM
function onSubmit() {
if (g_form.getValue('portal_validation') == 'Yes') // this prevents recursion
return true;
var subcat = g_form.getValue('sub_request_type'); // 31 for non po/adv
if (subcat == '31') {
var isAtt = new GlideAjax("x_aukms_cipla_ip.getAttachmentValidation");
isAtt.addParam('sysparm_name', 'getIsAttachment');
isAtt.addParam('sysparm_sysId', g_form.getValue("record_sysid"));
isAtt.getXML(getAttachmentReponce);
//stoping form submission
return false;
}
function getAttachmentReponce(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if (answer == "true") {
alert("Acknowledge all the details submitted are verified and correct");
g_form.setValue('portal_validation', "Yes");
g_form.submit();
} else if (answer == "false") {
alert("Mandatory to attach atleast one pdf as main attachment");
}
}
}
getIsAttachment: function() {
var gr = new GlideRecord("sys_attachment");
gr.addEncodedQuery("content_type=application/pdf^table_sys_id=" + this.getParameter('sysparm_sysId'));
gr.query();
if (gr.next()) {
return "true";
} else {
return "false";
}
}
For this Iam getting javascript error while running in protal