- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2024 03:45 AM
In the incident form in the sow I want to add text under the priority field which describe the priorty value, will change as the priority changes.
i cant find a way to do it, needs help.
this is the text that should describe the priorities:
Critical - System or critical process is down
High - Partial loss of service with severe impact on the business and no workaround exists
Medium - Low business impact. The result is an inconvenience, which may require a temporary workaround
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2024 04:20 AM
Hello @ofekg ,
Below is a onChange Client script that shows a field message when priority changes.
Script -
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (newValue == '1') {
g_form.showFieldMsg('priority', 'System or critical process is down', 'info');
} else if (newValue == '2') {
g_form.showFieldMsg('priority', 'Partial loss of service with severe impact on the business and no workaround exists', 'info');
} else if (newValue == '3') {
g_form.showFieldMsg('priority', 'Low business impact. The result is an inconvenience, which may require a temporary workaround', 'info');
}
}
Output-
Please mark this as "correct" and "helpful" if you feel this answer helped you in anyway.
Thanks and Regards,
Ashish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2024 02:59 AM
Hi @ofekg
try this
function onLoad() {
var priority = g_form.getValue('priority');
if (priority) {
g_form.clearMessages();
if (priority == '1') {
g_form.showFieldMsg('priority', 'System or critical process is down', 'info');
} else if (priority == '2') {
g_form.showFieldMsg('priority', 'Partial loss of service with severe impact on the business and no workaround exists', 'info');
} else if (priority == '3') {
g_form.showFieldMsg('priority', 'Low business impact. The result is an inconvenience, which may require a temporary workaround', 'info');
}
}
}
Thanks,
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2024 04:20 AM
Hello @ofekg ,
Below is a onChange Client script that shows a field message when priority changes.
Script -
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (newValue == '1') {
g_form.showFieldMsg('priority', 'System or critical process is down', 'info');
} else if (newValue == '2') {
g_form.showFieldMsg('priority', 'Partial loss of service with severe impact on the business and no workaround exists', 'info');
} else if (newValue == '3') {
g_form.showFieldMsg('priority', 'Low business impact. The result is an inconvenience, which may require a temporary workaround', 'info');
}
}
Output-
Please mark this as "correct" and "helpful" if you feel this answer helped you in anyway.
Thanks and Regards,
Ashish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2024 04:30 AM
it worked thank you very much, just before i mark your answer as a soloution, there is a ay to show the messege according to the priority not just when the priority changes? i want the desciptive txt will apear anytime im on the form in the sow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2024 04:54 AM
@ofekg Yes, for this requirement, you have to write an onLoad client script. Please try below-
function onLoad() {
var priority = g_form.getValue('priority');
if (priority == '1') {
g_form.showFieldMsg('priority', 'System or critical process is down');
} else if (priority == '2') {
g_form.showFieldMsg('priority', 'Partial loss of service with severe impact on the business and no workaround exists');
} else if (priority == '3') {
g_form.showFieldMsg('priority', 'Low business impact. The result is an inconvenience, which may require a temporary workaround');
}
}
Please mark this as "correct" and "helpful" if you feel this answer helped you in anyway. You can mark multiple answers as correct and helpful.
Thanks and Regards,
Ashish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2024 02:14 AM
its not working from some reason, i dont see the messege when loading the page yet, only when the priority value changes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2024 02:58 AM
Please check if you are getting the value of the priority by adding the following line next to the variable declaration of priority:
g_form.addInfoMessage(priority);
This should display the info message as below:
The above onLoad script is working for me-
Please mark my answer as "correct" and "helpful" if you feel this helped you in anyway.
Thanks and Regards,
Ashish