- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 09:46 AM
Hello SN Team,
Can you please tell me, how to identify field value of record changed using onSubmit client script.
Regards
Vinod
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 09:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 10:12 AM
Here is my code, while changing the view from Cxs_popup view to default view getting error "onSubmit script error: can not read properties of undefined(reading'changed')".
function onSubmit() {
//Type appropriate comment here, and begin script below
var field1 = g_form.getControl('subcategory'); //Get the 'Caller' field control
var field2 = g_form.getControl('business_service'); //Get the 'Short description' field control
var field3 = g_form.getControl('urgency');
if (field1.changed || field2.changed ) {
return confirm("Values on the form have changed.\nDo you really want to save this record?");
}
is there any other way where we can find out which field value of the record updated.
Note :The code working in sandbox but not in dev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 10:45 AM
hey vinod
try this once
function onSubmit() {
if(g_form.modified){
return confirm("Values on the form have changed.\nDo you really want to save this record?");
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 11:03 AM
Thank you Mohith. I have added one more if condition, it worked for me 🙂
if (g_form.modified) {
if(field2.changed){
return confirm("Values on the form have changed.\nDo you really want to save this record?");
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 10:05 AM
Here is my code, while changing the view from Cxs_popup view to default view getting error "onSubmit script error: can not read properties of undefined(reading'changed')".
function onSubmit() {
//Type appropriate comment here, and begin script below
var field1 = g_form.getControl('subcategory'); //Get the 'Caller' field control
var field2 = g_form.getControl('business_service'); //Get the 'Short description' field control
var field3 = g_form.getControl('urgency');
if (field1.changed || field2.changed ) {
return confirm("Values on the form have changed.\nDo you really want to save this record?");
}
is there any other way where we can find out which field value of the record updated.
Note :The code working in sandbox but not in dev