g_form.isNewRecord() is not working on portal

sruthi bhargava
Tera Contributor

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 

1 REPLY 1

RaghavSh
Kilo Patron

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