官术网_书友最值得收藏!

Creating and managing forms

In certain instances, we will require additional forms for the same entity. One obvious example is when we need to implement role-based forms. In such instances, a specific role could have access to only a subset of fields, while a different role could have access to other fields. We could have an overlap of fields available to all roles too.

Getting ready

Open the previously created solution, and navigate to the Countries entity we created. In the view of All Forms, by default, we only have the two forms, one for the normal use and one for mobile.

How to do it...

Adding a new form can be achieved as follows:

  1. From the All Forms view, select New | Main Form, or simply click on New.
    How to do it...
  2. On this new form, we can remove the Country Code and Display Sequence fields, by selecting each field and clicking on Remove on the ribbon.
    How to do it...
  3. Click on the Form Properties button on the ribbon, and on the Display tab (second from the left) to define a new name for our form.
    How to do it...
  4. Once the fields are removed and the form renamed, we can save and publish the new form.
    How to do it...
  5. With the form published, we can verify the listing of All Forms to make sure the form is saved.
  6. To verify how this form is presented to users, we can navigate to Country created in the system, and select from the available forms.
    How to do it...
  7. Now, both forms are available to be selected for users that have permissions to view both. We will be covering role-based forms later in a different recipe.

Removing a form is also a relatively simple process.

  1. Navigate in the solution package to the All Forms view and select the form to be removed.
    How to do it...
  2. Click on the Delete button.
  3. Publish all customizations.
    How to do it...

How it works...

Creating various forms for entities can help reduce the amount of scripting required to hide/show fields. We can assign specific forms to specific user roles, and thus reduce the amount of client-side processing on the form.

主站蜘蛛池模板: 汨罗市| 景东| 平潭县| 福鼎市| 南阳市| 满洲里市| 拉孜县| 永州市| 城固县| 台山市| 新巴尔虎左旗| 延川县| 汝南县| 琼结县| 杭锦后旗| 宁城县| 泗洪县| 忻城县| 河南省| 顺昌县| 铜鼓县| 德清县| 海林市| 苏尼特右旗| 遂平县| 高唐县| 武穴市| 定远县| 安泽县| 家居| 塔城市| 凭祥市| 阿克| 湖北省| 邢台县| 周至县| 丹江口市| 东宁县| 寿阳县| 乐都县| 巨野县|