Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

server side script for ui action was not working

Fahimas
Tera Contributor

my problem was the serverside code wasnot working 

condition : current.state == 2&&(gs.getUser().isMemberOf(current.assignment_group)||gs.getUserID===current.assigned_to)

code:

//making update through serverscript
function onHold(){  
   g_form.setMandatory('hold_reason',true);
 g_form.setMandatory('comments',true);

}
 //getting field value and setting them mandatory through clientscript
if(typeof window == 'undefined')
{
    current.state = 3;
    current.update();
    action.setRedirectURL(current);
}
please ensure that which was wrong




2 REPLIES 2

J Siva
Kilo Patron
Kilo Patron

Hi  @Fahimas 

May I know what's your requirement?

What are you trying to achieve here?

Fahimas
Tera Contributor

Hi @J Siva 

     my requirement is the button should be visible when state was inprogress and logged in user was membeer of assignment group or equal to assigned to field. when i click the button it should make the onhold reason and comment field  mandatory and it want to change the state into on hold