Is it possible to have a USERSETTING that should not be edited? Iโm capturing the device_id but donโt want the user to edit the value.
Thanks
Yes, usersettings has Show? and Editable? just like regular columns.
I donโt really understand that error message. Iโm not familiar with [_THISUSER], is that even a thing?
Thanks Marc, sorry the delay. Youโre right I have no idea where the [_THISUSER] came from. My initial settings for the field device_id is USERSETTINGS(device_id). The USERSETTING table has a UNIQUEID for the device_id initial value. Not sure where the [_THISUSER] is coming from.
Not sure why you are using usersettings on this case. Why don t you put context(โdeviceโ) into intial value for device_id field instead?
Iโll give this a try. Thanks Tsuji
I just quickly tested, it should workโฆ
you don t need to get the usersettigs engaged in your case, I hope.
Just did a quick test on a usersetting with Show? ON, Edit? OFF, and UNIQUEID() as Initial Value. It worked fine. However, a user has to actually go into the โSettingsโ view at least once (and Save) for this value to populate, and it seemed that a visible but not editable setting column did not make the โSettingsโ view show up in the menu. I had to add a 2nd setting column to get it to show up.
I proceeded to test pulling this value into a column via expression. Which also worked fine, and have discovered that
[_THISUSER].[option 2]
Seems to be equivalent to:
USERSETTINGS(โOption 2โ)
Perhaps an internal alias that was never documented?
Interesting. I would be ok with the value not showing at all in Settings but existing in the background - just canโt seem to get the error to go away as it stops functionality.
May need to send this one off to support.
Thanks Marc!
To clarify the [_THISUSER] syntax, that is an internal representation that USERSETTINGS() gets mapped into. Ideally this would not leak out into the error messages.
Internally, there is a user settings table with a single row in it and the expression is a dereference to that row.
Got it. Which would be most efficient in this case: USERSETTINGS() or CONTEXT()
or are they equivalent.
Thanks Praveen
Use USERSETTINGS() rather than [_THISUSER]
.
Usersetting does have a limit of its capabilities for now, such as
etc.
And recently , I noticed that deref does not work neither on usersetting.
For instance, we have usersetting REF type.
Prepare another usersetting ,read-only, which is just pull the value from another usersetting, using . i.e deref.
Refer to second usersetting in other place where we are able to use the expression.
Unfortunately 2nd usersetting which is pulling value by deref is not gonna work.
All in all, this makes me to tend to avoid to use the user setting , but create the own user setting table to do bits and pieces.
Good stuff! Thanks Tsuji!
User | Count |
---|---|
43 | |
26 | |
24 | |
14 | |
12 |