Giving alert pop up for the first save only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2014 01:01 AM
Hello All, I have given an alert message to a form. When I fill the form and click on Save button an alert gets generated. For this. I have written a simple client script. The code is
function onSubmit() {
alert('" Are you sure you want to save this record ? You will not be able to change The Type after Save/ Submit."');
}
This is working accordingly when i Click on save button and saving it for the first time. Now the problem is occuring when I am doing any changes in the same form again and clicking save button, the same pop up is appearing again and again. How can I modify it like only for the first save, the alert should get triggered not when I am modifying the form again and clicking on save button. Please suggest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2014 09:29 PM
If this is in a workflow you may need to adjust when the workflow starts so
drafts can be edited before requesting approval etc.
On Thursday, 27 November 2014, Chaitanya kshirsagar <
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2014 08:08 AM
Hello Gareth,
Its not a Workflow, its just runs on a client script.
Thanks,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2014 01:12 AM
Hi Chaitanya,
If the record is being saved for the first time, ie, its not already present in the db , its sys_id in the current URL is -1.
You can check this by clicking new or create new on any record anywhere. So all you have to do here is read the URL and look for the parameter sys_id.
if(sys_id==1)
{
alert("*****");
}