In Client scripts, setvisible() or setDisplay() is not honored when used along with setmandatory()DescriptionWhen using setVisible() or setDisplay() in a Client Script along with setMandatory(), the visibility methods do not behave as expected. Steps to Reproduce Starting from the Istanbul release, ServiceNow intentionally blocks the use of setVisible() or setDisplay() on mandatory fields in client scripts. This is a designed behavior to prevent issues where a field is marked as mandatory but is hidden, making it impossible for users to complete the required field.WorkaroundTo control visibility and mandatory behavior together, use one of the following supported approaches: Preferred: Use UI Policies UI Policies support both visibility and mandatory settings.Recommended over client scripts for better performance, maintainability, and execution reliability.See: Use UI Policies instead of Client Scripts Alternative: Separate Client Scripts If UI Policies don't meet your requirements:Use two separate client scripts: One for setMandatory()Another for setVisible() or setDisplay() This separation ensures consistent execution order and avoids conflicts. Best Practice Avoid using setMandatory() and setVisible() together in the same client script.Related Problem: PRB1284668