g_form.isNewRecord() is not working on portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2022 12:25 AM
Hi All,
Before submission of the catalog form through service portal i want to check the record is new in an onchange catalog client script , i used the function g_form.isNewRecord() but its not working as expected. Is there any other way to check if a record is new on portal.
if(g_form.isNewRecord())
{
if (isLoading || newValue != '') {
var ajax = new GlideAjax('ACNgetopeneddate');
ajax.addParam('sysparm_name', 'calculateDate');
}
Thanks,
Sruthi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2022 12:40 AM
g_form.isNewRecord() do work on portal.
Try below :
if (isLoading || newValue != '') {
if(g_form.isNewRecord())
{
var ajax = new GlideAjax('ACNgetopeneddate');
ajax.addParam('sysparm_name', 'calculateDate');
}
}
Raghav
MVP 2023