Anybody knows how to disable certain defect fields of existing defects? Here is scenario,
when QA submit new defect, the "Detected by" is filled in QA's initial;
After the defect is submitted, the "Detected by" contains QA's initial (who report the defect) and nobody else (even QA self) can edit it. How?
My scenario is, when QA / others input the defect, the field is filled in QA's login name (means the field is writable). After defect is inputted, nobody else can modify the value in that field (read only now).
Have you tried your code? Where do you expect to place it and what do you expect the result to be?
You are only locking the field after it has already been changed in the current session.. seems a little late to me.
All you need to do is set ("BG_DETECTED_BY").IsReadOnly = True in the _MoveTo event.
This will lock the detected by field for all 'existing' defects. The field will remain unlocked in _New, so that it can be modified when a defect is raised (for example when Tester B raises a defect on behalf of Tester A).
You may wish to consider coding an exception for Administrators so that the field can be modified by someone in the event that an error is made.