Make a field editable in native view and read only in workspace

Vamsi43
Tera Contributor

Hi Team,

I require the a field to be editable in native view but should be read only in workspace view.

Please let me know How can we achieve This.
Thank you.

1 ACCEPTED SOLUTION

Tai Vu
Kilo Patron
Kilo Patron

Hi @Vamsi43 

You can implement an UI Policy, making a field readonly for a specific view of a table. Sample below.

Timi_0-1724147892898.png

 

In case you'd like to implement a Client Script. Sample below

Timi_1-1724147983166.png

 

Cheers,

Tai Vu

View solution in original post

8 REPLIES 8

Sid_Takali
Kilo Patron
Kilo Patron

Hi @Vamsi43 try below code . It will give you view names in client script. You can use onload client script

 var view = getView(); //get viewname
  if (view == 'workspace'){
  g_form.setReadOnly('fieldname',true);
  }

 

Regards,

Sid

 

Tai Vu
Kilo Patron
Kilo Patron

Hi @Vamsi43 

You can implement an UI Policy, making a field readonly for a specific view of a table. Sample below.

Timi_0-1724147892898.png

 

In case you'd like to implement a Client Script. Sample below

Timi_1-1724147983166.png

 

Cheers,

Tai Vu

Vamsi43
Tera Contributor

Hi @Tai Vu 

I'm trying write it form ui policy on business_unit table.

But there's no view values to lookup in "View" field. 

 

Vamsi43_0-1724151914354.png

 

Hi @Vamsi43 

OOTB the Business Unit [business_unit] table only has 1 default view. Have you defined a specific view for this table in the workspace?

If not, we should initiate a specific view first, which is applied within the workspace. E.g: Incident/Problem tables have the sow view in the Service Operation Workspace.

Timi_0-1724307972902.png

 

Cheers,

Tai Vu