I would remove RequiredAttribute from your model and test it as soon as you click on your controller and test it against any reasons why you won't need it.
If it falls into the case when it is required, and the value does not fill out, add the error to ModelState manually
ModelState.AddModelError("DepartmantCode", "DepartmantCode is Required");
You would simply lose client-side validation.
source share