The Zurich release has arrived! Interested in new features and functionalities? Click here for more

make filed Readonly in business rule

venkatrajesh
Tera Expert

in client side we can achieve this byusing : g_form.setReadonly('impact'',true) or else UI policy action but in

server-side script   business rule   i have tried as below

current.setReadonly('impact',true);

but not working

can any one have a idea?

5 REPLIES 5

Harish KM
Kilo Patron
Kilo Patron

Btes approcah would be to use   ACL to make field readonly .Since it works both form and list


Regards
Harish

Alikutty A
Tera Sage

Hi,



What is your use case? You should use Access controls for making fields read-only at server side.





Thanks


PS: Hit like, Helpful or Correct depending on the impact of the response


David Stutter
Tera Guru

Have a look into the wiki article how business rules work:


How business rules work



You could use the current.setAbortAction(true) method to prevent the saving.


Abort a database action in a business rule



The best approach would be the Access Control Rules:


Access control rules


You define which user/roles have access to explicit tables/records/fields.


amlanpal
Kilo Sage

Hi Venkat,



Setting a field as ReadOnly or Mandatory or Visible is totally on UI Side, i.e, on the client side. So you can achieve this via Client side scripting (Client Script, UI Policy etc.). But when you say Business rule, you mean to set those client side behavior in the server side--doesn't this sound odd!?!


Well, you also have options to do so from ACL and Dictionary entries apart from Client Script and UI Policy. Could you please elaborate what drives you to think about Business rule for setting a field ReadOnly?



I hope this helps.Please mark correct/helpful based on impact