UI policies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi All,
I have configured UI policies to make fields visible, read-only and mandatory. But it's not working as expected.
Requirements:
- If Use main address as mailing address is set to false, then show address related fields (address search, can't find address, street, street number, suburb, state, post code, country). Else it should be hidden.
- All address related fields should be mandatory.
- If can't find address is set to true, then address related fields should become editable, mandatory. (A search is implemented on address search field. If we search any address and select any of the address, it inserts values in address related fields).
If can't find address is set to false, then address related fields should be read-only, mandatory
Currently working functionality:
- If Use main address as mailing address is set to false, then address related fields are visible. Else it is hidden
- If can't find address is set to true, then address related fields becomes editable, mandatory. Address search is non-mandatory.
- If can't find address is set to false, then address related fields becomes read-only. Address search is mandatory.
Issue:
- If can't find address is false, then address related fields are not coming as mandatory. it should be mandatory always.
Please help me to fix this issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @pallavigaik
Try this:
- a. UI Policy 1: Show/Hide Address Fields
Condition: Use main address as mailing address is false
b.Under the UI Policy Actions, set the following fields to Mandatory: True and Visible: True:
- Address Search
- Can't Find Address
- Street
- Street Number
- Suburb
- State
- Post Code
- Country
- Note: Set the policy to "Reverse if false" so that these fields automatically hide
- onChange Client Script: Manage Editability and Mandatory Rules
- Type: onChange
- Field Name: cant_find_address
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
if (newValue == 'true' || newValue === true) {
g_form.setReadOnly('street', false);
g_form.setReadOnly('street_number', false);
g_form.setReadOnly('suburb', false);
g_form.setReadOnly('state', false);
g_form.setReadOnly('post_code', false);
g_form.setReadOnly('country', false);
}
else {
g_form.setReadOnly('street', true);
g_form.setReadOnly('street_number', true);
g_form.setReadOnly('suburb', true);
g_form.setReadOnly('state', true);
g_form.setReadOnly('post_code', true);
g_form.setReadOnly('country', true);
}
}