- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 02:53 AM
Hi All,
There is one requirement in incident table when category is "Dev" and subcategory is "Test" then i want populate the info message under the subcategory field(Based upon the subcategory is depend field of category) So i have created the one onchange client script, it's not working i have try to get the value by using the console, even i didn't get, any one help on this part?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2025 10:37 PM
Hello @DeepikaR1661877
- No, You cannot populate link using g_form.showfieldmsg().
- The g_form.showFieldMsg() method is primarily used to display messages (such as error, warning, or informational messages) below a field.
Hope this helps!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 03:20 AM
Hello @DeepikaR1661877
What value you got in alert statement? Try to check value you are getting for both Category & Subcategory.
Does it pass if loop? If yes, then it will work. Also, the on change is written on which field is it Category or Subcategory?
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 03:27 AM
Hi @Viraj Hudlikar ,
There is no value getting by using the alert , change is written on the Subcategory field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 03:37 AM
@DeepikaR1661877 - If no alert means value not coming proper. Since this on change client script on subcategory so you can get its backend value by using newvalue easily.
Try to put alert as below and see when you change subcategory what is coming up and then use same value to compare in your if loop.
alert("Category"+g_form.getValue('category'));
alert("SubCategory"+g_form.getValue('subcategory'));
Below is sample code for client script and it works for me see if this can help you.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
alert("Category"+g_form.getValue('category'));
alert("SubCategory"+g_form.getValue('subcategory'));
var subcategory = newValue;
var category = g_form.getValue('category');
if(subcategory == 'email' && category == 'inquiry'){
g_form.addInfoMessage("This is infomessage");
}else{
g_form.clearMessages();
}
}
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 04:07 AM
I have modified the code, It's working but the info mes is not populating under subcategory.