AnsweredAssumed Answered

SDM Requests - Set Priority based on category_urgency

Question asked by J_W on Feb 13, 2018
Latest reply on Feb 15, 2018 by J_W

SDM 14.x


Customers have the flip Incident <> Request customization and are not using Priority Calculation at this time for that reason.


The requirement being tested is that the default Priority for a Request should be '3' - when submitted by an Employee role via the detail_cr.htmpl.  The Priority is hidden on the form.  This is set via Data Partition.


However, the exception is when the Category has a value on the category_urgency field. We then need to set Priority based on some criteria (in development).  For this test, we need to set the Priority to '5' when the category_urgency is '0'.


My approach was to modify the emp_change_category_func() which is called by the onChange() event on the Category selection on the form. ( I'm not considering SPEL triggers at this time as it requires system restarts, but may later. )


I cannot seem to get the [category.category_urgency] based the Category selected which fires the event.


I get the persid using:


var cat_persid = document.forms["main_form"].elements["SET.category"].value;


and the sym using:


var cat_sym=document.getElementsByName("KEY.category")[0].value;


The category_urgency isn't currently captured as part of the form, and would be empty anyway during initial ticket creation.


Is this a valid approach and I'm missing some syntax or is there a better way?


(I need a refresher on the use of SET, KEEP, and KEY in context of the main form and passing to functions!)