Using Sugar Logic to conditonal make fields read only

bsoremsugar —  November 8, 2012 — 2 Comments

I saw a great question recently on the forums

i have want Relate field make read only for the particular condition.When user create new record then Relate field is editable but user edit the record then relate field make read only .

This is a prime case for using Sugar Logic, as at the code level there are many other Actions available aside from the pedestrian ones that can be edited in Studio itself. For this use case, the ReadOnly comes into play, and thanks to community member and CTO at Sugar partner NEPO Systems Jeff Bickart here is a great code example on how to do this…

Thanks Jeff for the great example! And as a reminder, this only works for the commercial editions of Sugar ( i.e. not CE )

2 responses to Using Sugar Logic to conditonal make fields read only

  1. 

    Didn’t realize this was built in like this. Nice tip.

  2. 

    I added a field in the Users module to classify every user into the subsidiary he/she works in.
    There are some fields that should only be used by some subsidiaries and doing this with the ACLRoles is far too much work.
    So I tried this ‘trigger’ => equal($current_user->subsidiary, ‘tta’), but it didn’t work…..is it possible to define a trigger for the $current_user or for any field outside of the module the depency works in?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s