Fields Declarions -action assigmnets

Dolev Peretz
Tera Contributor

Hi everyone,

 

i  need to create icon field in SOW , i use Fields Declarions -action assigmnets but its not working onChange field. 
how i can make it work onChange field to show the icon in SOW?

if have anther way to show icon in SOW by OnChange field?

 

TNX

2 REPLIES 2

Chetna_dev
Kilo Sage

To show an icon in a Statement of Work (SOW) field on change, you can use a Client Script or Field Decorators. Here’s how:

Option 1: Client Script

  1. Create a New Field: Ensure you have a field (e.g., icon_field) to hold the icon.

  2. Add a Client Script:

    • Go to System Definition > Client Scripts.
    • Create a new script:
      • Table: Your SOW table.
      • Type: onChange
      • Field name: Your target field.
  3. Script Example: 

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') return;

var iconHTML = '';
if (newValue === 'desired_value') {
iconHTML = '<img src="your_icon_url" alt="Icon" style="width:16px;height:16px;">';
}

g_form.setValue('icon_field', iconHTML);
}

Option 2: Field Decorators

  1. Field Declaration:

    • Go to System UI > Field Decorators.
    • Create a decorator for the target field.
  2. Configure:

    • Set it to show an icon based on conditions, but note this may not respond to onChange.

Option 3: UI Policy

  1. Create a UI Policy:

    • Go to System UI > UI Policies.
    • Define conditions for the icon visibility.
  2. Add Actions:

    • Use UI Policy Actions if needed.

if you found this helpful please accept as solution and mark helpful

best

Chetna

Hi,

tnx you for try to help me,
but your answer 1,3 not working on service opertion workspace, 
and 2 is not work on change option. 

i need its work on service opertion workspae when the field changes.
you maybe know how to do this?