I have a particular need for a record, when being edited, to be marked as read-only as opposed to being writable when the user first adds the record. That is to say, I want the field to act like a regular text field on the "Add page" while being read-only on the "Edit page". I have noticed that there is a flag to apply some selections from "Add page" to "Edit Page", but that appears to only be for default values. When looking up the JavaScript API, I noticed the method makeReadonly() and made a very simple implementation:
ctrlUser = Runner.getControl(pageid, 'st_user');
alert (ctrlUser.isReadonly()); // returns false
ctrlUser.makeReadonly();
alert (ctrlUser.isReadonly()); // still returns false
However, this does not work, although the other JavaScript API does work. Other (potentially) useful information include that I have the field in a tab group, that it has a regular expression validation, and that is is a required. I am not quite sure what is causing the issue.
Thank you for any input.