- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2018 01:06 AM
Hi All,
I'm trying to add a confirm box before submitting a new record.I'm using below client script for this,
function onSubmit() {
//Type appropriate comment here, and begin script below
if(g_form.isNewRecord())
{
var valR=g_form.getReference("escalation_severity",popEscType); //Reference field
}
function popEscType(valR)
{
if(valR.name=='Management')//Management
{
var answer = confirm("Do you have the management approval to perform this escalation?");
if(answer == false)
{
return false;
}
}
}
}
After using this script i'm getting a confirm box .
But after clicking on cancel ,new record is still getting submitted.
Please tell me what is wrong in this script.
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2018 01:35 AM
if you dont want to use sysid then use
g_form.getDisplayBox('<reference field name>').value;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2018 01:13 AM
kindly refer the thread below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2018 01:27 AM
Hi
I was using below script ,
//Type appropriate comment here, and begin script below
if(g_form.isNewRecord())
{
var val = g_form.getValue('escalation_severity');
if(val=='7de67373b3500300ff6e6e5f26a8dcc9')//Management
{
var answer = confirm("Do you have the management approval to perform this escalation?");
if(answer == false)
{
g_form.addInfoMessage("Escalation cancelled");
return false;
}
}
}
It was working fine but i don't want sys_id in script.So I'm using g_form.getReference(), But it is not working as per the requirements
Can you please help me

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2018 01:35 AM
if you dont want to use sysid then use
g_form.getDisplayBox('<reference field name>').value;