Please follow the steps for implementing your functionality.
· Add a new field (let it be named as currentViewName) into the main schema.
· Set the present form view name into the "currentViewName" field. This can be done by writing the below code in the "OnSwitchView" event.
thisXDocument.DOM.selectSingleNode("/my: myFields /my:currentViewName").text = thisXDocument.View.Name;
· Now add a "Data Validation" for the “field1” field. So that if currentViewName is equal to the viewname in which you want to show the “field1” field mandatory ,then set the Screen Tip "Cannot Be Blank".
I hope the above steps will help you.