If you have a recordreference and want to use the value of a field in the recordreference, you can use it in this way:
You might even do something as this
BUT for some reason, it can happen this crashes the NAV client. I had the problem with 50SP1 Build 30488 (I don’t know about more recent versions of NAV and even less in case you are in RTC). The weird part is that it doesn’t always happen. Recompiling the object doesn’t help. It might help adding some commands before the statement. So I think it is more a compiler-error.
But there is a way to completely avoid the problem. Don’t use TheRecordReference.FIELD(10).VALUE directly, but first put the field you need into a field-reference and then use the VALUE of that field-reference. Something like this:
SomeOTHERFieldReference := TheRecordReference.FIELD(10);