Inside sharepoint on-premises 2013, when working with sharepoint lists, i receive many requirements, such as:-
- To have 2 cascading drop down fields. for example (Main Category + Sub Category)
- To have a field set to mandatory only if another field is entered.
- To have an advance search for the list, with the ability to apply search on number fields by defining greater than or less than.
Now to achieve the above inside SP on-premises, i do these things:-
- For the cascade drop-down fields. I define 2 separate lists, with a lookup columns between them. for example i create a list named MainCateogry, and anther list named Sub-Cateory with a lookup column referencing the main category list.
Then I create 2 drop-down fields. one field containing all the main category options (as defined inside the MainCategory list) + another field containing all the sub category options (as defined inside the SubCategory list). then i add a script inside the create/edit list forms, which will retrieve the relation from the main/sub category lists and populate the subcategory drop-down column accordingly, based on what the user select for the main category drop-down. so if user select option
ABCfor the main category >> the script will query the subcategory list and retrieve all the items which are associated with the
ABCitem >> then it will populate the subcategory drop-down accordingly.
For setting a field as required in-case another field is entered, i also add a script tot the create/edit forms and i define the validation inside the
Last point, for the advance search i enable metadata navigation for the list and it will show an advance search for the list.
But now we have moved to SharePoint online, and my above customization will only work on classic UI. while on mdoern UI it will not. i know that in modern UI the way to customize the list forms is to use PowerAPP. but even if i chose PowerApps we will lose the ability to have an advance search, where the modern UI filtering is useful but does not provide the same advance search we get inside the metadata navigation. so for now inside our SP online i define to render all the lists which have the above customization in classic UI, as follow:-
but my question is if my appraoch is valid/recommended/future-proof, in-respect to these 2 main points: 1. forcing the list to render inside classic UI. 2. doing the customization on the list forms by embedding scripts? mainly to define a cascade drop-down fields + conditional mandatory validation?