How to editable particular field based on Assigned to or assign?

Ramanjaneyuv
Tera Contributor

How to editable particular field based on Assigned to or assign?

Scenario:

1. Incident assign to particular user .

2. Assign to  User  have only Editable Short_description  field, Remaining users  have read only .

 

Thanks

Ram

4 REPLIES 4

Astik Thombare
Tera Sage

Hi @Ramanjaneyuv , 

 

You can use on load client script to check if currently logged in user is present in assigned to or not and based on that you can make fields read only or editable -

 

       If my reply helped with your issue please mark helpful 👍 and correct ✔️ if your issue is resolved.

 

                         By doing so you help other community members find resolved questions which may relate to an issue they're having

 

 

Thanks,

 

Astik

SN_Learn
Kilo Patron
Kilo Patron

Hi @Ramanjaneyuv ,

 

You can achieve this by write ACL on incident.assigned_to

 

Script:

 

answer = false;
if (gs.getUserID() == current.assigned_to) {
    answer = true;
}

 

If this solution resolves your query, kindly mark it as the accepted solution and give it a thumbs up. 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

Community Alums
Not applicable

Hi @Ramanjaneyuv ,

I tried your problem in my PDI and it works for me. You can create OnLoad client script and add below code 

function onLoad() {
   //Type appropriate comment here, and begin script below
   alert('Inside Show Desc = ' + g_user.userID);
   alert("assigned_to = " + g_form.getValue('assigned_to'))
   
   if(g_form.getValue('assigned_to') != g_user.userID){
		g_form.setReadOnly('short_description', true);
   }
   else{
	g_form.setReadOnly('short_description', false);
   }
}

Result 

Assigned to Beth short description is read only 

SarthakKashya2_0-1714375806995.png

Assigned to me it is editable 

SarthakKashya2_1-1714375845518.png

 

Please mark my answer correct and helpful if this works for you

 

Thanks and Regards 

Sarthak

Community Alums
Not applicable

Hi @Ramanjaneyuv ,

If this works for you please mark my answer correct 😀

 

Thanks and Regards 

Sarthak