UI policy vs Data Policy

Prathmeshdagade
Tera Contributor

Can anyone tell me difference between UI policy and Data Policy?, and also Best Practices while defining them

8 REPLIES 8

VijayaMannapura
Tera Guru

@Prathmeshdagade UI Policy is to control visibility on the UI form and Data policy is to control the Data entered into a field. 

Create couple of them and you will get it. 

adityahubli
Tera Guru

Hello @Prathmeshdagade ,

 

I have outlined some differences between UI Policy and Data Policy below.

 

UI Policy

  • UI Policies are client-side and are mainly used to configure Read-only, Mandatory, and Visible fields.

  • Scripts can be written inside UI Policies for additional client-side logic.

  • UI Policies are applied only on UI forms.

  • UI Policies do not work for onCellEdit (list view editing).

UI Policy =>Data Policy Conversion (Prerequisites)

To convert a UI Policy into a Data Policy, the following conditions must be met:

  1. Global checkbox must be checked

  2. No visibility actions should be present

  3. Run scripts checkbox must be unchecked


Data Policy

  • Data Policies support only Read-only and Mandatory actions.

  • Data Policies run on the server side, so they are enforced during insert or update operations in the database.

  • Scripting is not supported in Data Policies.

  • Data Policies apply to records created or modified via:

    • Import Sets

    • Mobile UI

    • Web Services / APIs

    • Integrations

Data Policy  =>UI Policy Conversion

  • There are no prerequisites for converting a Data Policy into a UI Policy.

 

(Note - to disble data policy during modifying/creating record using script like gliderecord we need set gr.setUseEngine(false))

 

 

If this helps you then mark it as helpful accept as solution.

Regards,

Aditya,

Technical Consultant

SumanthDosapati
Mega Sage

@Prathmeshdagade 

UI Policy works only client side and Data policy works both client side and server side also.

Client side (for a user in a browser) 

Server side (in the background like Integrations, scripts, etc)

 

UI Policy - Mandatory, visibility, read-only

Data Policy - Mandatory, Read-only

 

Example :

CASE 1: A field made mandatory in incident using UI Policy.

Result :

Incident cannot be created by user in any browser without filling field

Incident can be created by integrations, APIs, scripts, flows, etc without filling the field.

 

CASE 2: A field made mandatory in incident using Data Policy.

Result :

Incident cannot be created by user in any browser without filling field

Incident cannot be created by integrations, APIs, scripts, flows, etc without filling the field.

 

Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth