- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2019 07:53 PM
So, it is like I have 1 category and 5 subcategory, each element in subcategory have a different value (1 or 2 or 3, it just like urgency and impact but it is subcategory) and these wil be used to calculate the priority field. I'm new to SN so I don't know much, How should I do it? Thank you.
If possible, may you show me how should I do it in detail? Like where to go, coding.. etc
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2019 09:57 PM
Here is the screenshot for your reference
Mark correct and helpful if this solves.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2019 08:52 AM
you'll have to use an on-change client script, configure the form, open client scripts, create a new one, select on-change.
In the script you'll have to get the value of the subcategory from the form and then calculate priority based on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2019 08:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2019 07:04 PM
thank you, but can you help me with an example pls? I'm don't know much about java script 😛
I can think about sth like newValue=='Email'{
g_form.setValue('priority', 1);
}
but if I want to get the calculation, like the category priority value is 1point, subcategory1 is 2point, subcategory2 is 3p, like the impact and urgency, and it will be calculate so the Priority show value of average of them, so how should I do?
TKS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2019 09:37 PM
Hi,
Try below code
Write onSubmit() client script:
function onSubmit() {
var a = parseInt(g_form.getValue('impact'));//here my field name is impact (set your field name instead of impact)
var b=parseInt(g_form.getValue('urgency'));//my second field name is urgency(set your name value instead of urgency)
var c=(a+b)/2;
alert('value'+c);
g_form.setValue('u_priority2',c);//here u_priority2 is my actual name of field(use your respective field name in which you want to show average)
}
let me know if you have any questions.
mark it as correct/helpful,if it helps you.
Regrads,
Ragini