In the standard Change, When click on the "CLOSE" button -close information fields need to be editable but still it showing readonly. How can do editable using UI Action ?

chaitanya Kuma3
Giga Contributor

In the standard Change, When click on the "CLOSE" button -close information fields need to be editable but still it showing readonly. How can do editable using  UI Action ?

A field is read only. I would like select users to be able to click on a button so the field is made not read only for them to update it

The field should NOT be open for edits all the time, only when that button is clicked.

1 ACCEPTED SOLUTION

Hi,

 

In this case you can abort the form submission when user clicks on "close" button then first they need to fill the close code and notes and then able to submit the record.

 

For this you need to write both client and server code in one UI action. 

Open the ui action that you have and use the below code for client side validation for abort form submission.

Name: Close
Action name: close_change
Client: True
Form button: True
Onclick: closeTicket();
Condition: current.state == 6 //Implementation state
Script:

//Client-side 'onclick' function
function closeTicket(){
if(g_form.getValue('close_code') == ''){
g_form.setMandatory('close_code', true);
g_form.showFieldMsg('close_code','Close Code are mandatory when closing the ticket.','error');
return false; //Abort submission
}
//Call the UI Action and skip the 'onclick' function
gsftSubmit(null, g_form.getFormElement(), 'close_change'); //MUST call the 'Action name' set in this UI Action
}

//Code that runs without 'closeTicket'
//Ensure call to server-side function with no browser errors
if(typeof window == 'undefined')
serverReopen();

function serverReopen(){
//Set the 'State' to 'Close', update and reload the record
current.state = 2;//state value for close
current.update();
action.setRedirectURL(current);
}

 

Mark this as Helpful/Correct, if Applicable.

 

Regards,

Sourabh

View solution in original post

3 REPLIES 3

Sourabh26
Giga Guru

Hi,

As the ticket is closed now you it is not recommended to update anything on the ticket after the closure.

 

In your case, you can make the closure information details as mandatory before closing the change so that user need to filled the required information before closure of the ticket.

 

Mark this as Helpful/Correct, if Applicable.

 

Regards,

Sourabh

Hi Sourabh,

Based on the story I have to provide the notes(necessary) before close the record. I mean when i click on the close button.

Hi,

 

In this case you can abort the form submission when user clicks on "close" button then first they need to fill the close code and notes and then able to submit the record.

 

For this you need to write both client and server code in one UI action. 

Open the ui action that you have and use the below code for client side validation for abort form submission.

Name: Close
Action name: close_change
Client: True
Form button: True
Onclick: closeTicket();
Condition: current.state == 6 //Implementation state
Script:

//Client-side 'onclick' function
function closeTicket(){
if(g_form.getValue('close_code') == ''){
g_form.setMandatory('close_code', true);
g_form.showFieldMsg('close_code','Close Code are mandatory when closing the ticket.','error');
return false; //Abort submission
}
//Call the UI Action and skip the 'onclick' function
gsftSubmit(null, g_form.getFormElement(), 'close_change'); //MUST call the 'Action name' set in this UI Action
}

//Code that runs without 'closeTicket'
//Ensure call to server-side function with no browser errors
if(typeof window == 'undefined')
serverReopen();

function serverReopen(){
//Set the 'State' to 'Close', update and reload the record
current.state = 2;//state value for close
current.update();
action.setRedirectURL(current);
}

 

Mark this as Helpful/Correct, if Applicable.

 

Regards,

Sourabh