Code: Select all
def Task_Code_ReadOnly(args):
# Allow changes if Blank
if args.Context.Code == None or args.Context.Code == '':
args.Value = False
else:
args.Value =
The idea in the above code is simple. If there is no Task Code, allow a user to input values. If a task code exists, make the field read only.
The functionality is working correctly. After a user inputs data into a blank Task Code, the new code will remain and the field will become ReadOnly.
The issue is an undesired "Can not access member" error pop-up. How do I prevent the error from showing?
Summary:
- Task Code is Blank and not ReadOnly
- Task Code is entered
- An undesired "Can not access member" error appears.
- The new task remains and the field is ReadOnly.
Notes:
- If the task is selected from a lookup table the error does not appear.
- I attempted to add the value with "Task_Code_Value(args), but could not configure it correctly."