I have a 'clients' table where I would like to make all controls read-only if the "Active" value in the record is "No".
The Yes/No field is actually a "dead-man's trigger' of-sorts where the average app 'user' should not be able to change the record once the value is "No".
While I can successfully make an individual control read-only
using the Javascript OnLoad event for my Edit page:
var ctrlACT = Runner.getControl(pageid, 'Active');
if(ctrlACT.getValue() == "No")
ctrlACT.makeReadonly();
and subsequently selectively makeReadOnly other controls:
I am struggling to set all controls to read-only (even without a conditional if =statement).
I stumbled around the help pages and found reference to making fields required and tried to 'adapt' the code to my needs:
var recCtrlsArr = Runner.controls.ControlManager.getAt('clients');
for(var i=0;i<recCtrlsArr.length;i++)
{
var ctrl = recCtrlsArr[i];
ctrl.makeReadOnly();
}
However, this code has no effect, no error:
Am I on the wrong track?
..{wonk}