Ui action button

sushma9
Tera Contributor

Hi ,

Good day  to all,

I  have requirement On Ui action . I have  created a Ui Action Button " MyAssignmentgroup " and when i clicked on it worknotes should be mandatory and after filling the  worknotes and again when i clicked on " MyAssignmentgroup  "  button then assignment group should be autopopulated to group "X"

Please find the attached screenshot and script i  have written . Kindly Please let me now if any modifications has to be done.

 

Script :

onclick();

function onclick() {
g_form.setmandatory("work_notes");
gsftSubmit(null, g_from.getFormElement(), "MyAssignmentGroup");
}
if (typeof Window = "undefined")
setRedirect();

function setRedirect() {
current.update();
action.setRedirectURL(current);
}

3 ACCEPTED SOLUTIONS

As far as I can see, it is now exactly the same as I have tested.

What exactly is not working? Just to make sure, the worknotes are on the form view? Otherwise it cannot be set mandatory.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

View solution in original post

Hi @sushma9

 

It was not an update set, its the UI Action. So should be visible in your incident form now.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

View solution in original post

It was the UI Action itself, not an update set. Take a look in your incident form. The UI Action is already there.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

View solution in original post

23 REPLIES 23

Peter Bodelier
Giga Sage

Hi @sushma9 

 

Try this:

function onclick() {
g_form.setMandatory("work_notes",true);
gsftSubmit(null, g_from.getFormElement(), "MyAssignmentGroup");
}
if (typeof Window = "undefined")
setRedirect();

function setRedirect() {
current.assignment_group = '<<sys_id>>';
current.update();
action.setRedirectURL(current);
}

Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Hi Peter,

Thanks for your response. When i trying with the above provided code i am getting the error. Please find the attached error .

sushma9_0-1694435826139.png

 

@sushma9 

 

Ah right, missed one error in your script:

 

function onclick() {
    g_form.setMandatory("work_notes", true);
    gsftSubmit(null, g_from.getFormElement(), "MyAssignmentGroup");
}
if (typeof window == "undefined")
    setRedirect();

function setRedirect() {
    current.assignment_group = '<<sys_id>>';
    current.update();
    action.setRedirectURL(current);
}

Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Hi Peter,

 Error was resolved but  when i clicked on the  "MyAssignmentgroup " button  work notes is not getting mandatory  .

Note : I tried for other fields also like short description, description