How set readOnly dynamically in record.js?

I'm need set readOnly in custom field when logged user not admin in record.js

if(app.user.get('type') == 'admin')
  //set readOnly field
else
  //set editable fiel

Parents Reply
  • There definitely is a difference. This particular approach is only feasible if you are only concerned about the behavior of the field within the main web app and only within that specific view. In other words, that same field would appear as an editable field were you to look at it via SugarCRM Mobile.

    Likewise, this approach has some greater flexibility in other areas when compared to dependencies. For example, you could examine the current user and determine whether the field should or shouldn't be read only based solely off of that.

    In short, there are some trade-offs with each approach and Mobile tends to be the area of concern. If you are not using Mobile (or don't plan on doing so), which option you choose is a lesser concern.

Children