When incident ticket assignee selects Pending appointment option then date field should appear below

BheemavarapuTej
Tera Expert

When incident ticket assignee selects Pending appointment option then date field should appear below the state field.

1 ACCEPTED SOLUTION

Clara Lemos
Mega Sage
Mega Sage

Hi @BheemavarapuTej ,

 

If you need the date field to be shown when Pending Appointment is selected, you can add the date field to your form below the state field.

After that, you can create an UI policy so that the field is only displayed when Pending Appointment is selected.

To create the UI Policy you can follow this steps, 

navigate to System UI> UI Policies

Click on 'New' ( top right) 

Select the Incident table, and add a meaningful short description 

Set the condition for when Pending Appointment is selected

Use Advanced view ( you can switch that on the related link , at the bottom left), and verify that the reverse if false check box is selected ( it is located under the condition)

Save your form

Now at the bottom you'll see a related list ' UI Policy Actions' , click on New

Select your Date field, and set Visible to true. 

 

If that helps please mark my answer as correct / helpful!
And if further help is needed please let me know

Cheers

 

 

View solution in original post

2 REPLIES 2

Clara Lemos
Mega Sage
Mega Sage

Hi @BheemavarapuTej ,

 

If you need the date field to be shown when Pending Appointment is selected, you can add the date field to your form below the state field.

After that, you can create an UI policy so that the field is only displayed when Pending Appointment is selected.

To create the UI Policy you can follow this steps, 

navigate to System UI> UI Policies

Click on 'New' ( top right) 

Select the Incident table, and add a meaningful short description 

Set the condition for when Pending Appointment is selected

Use Advanced view ( you can switch that on the related link , at the bottom left), and verify that the reverse if false check box is selected ( it is located under the condition)

Save your form

Now at the bottom you'll see a related list ' UI Policy Actions' , click on New

Select your Date field, and set Visible to true. 

 

If that helps please mark my answer as correct / helpful!
And if further help is needed please let me know

Cheers

 

 

Amit Gujarathi
Giga Sage
Giga Sage

HI @BheemavarapuTej ,
I trust you are doing great.
Please find the below sample code for the same

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

    // Replace 'pending_appointment' with the actual value of the Pending appointment option
    // Replace 'your_date_field' with the actual field name of your date field
    var pendingAppointmentValue = 'pending_appointment'; // Update this with the correct value
    var dateFieldName = 'your_date_field'; // Update this with the correct field name

    // Show or hide the date field based on the selection
    if (newValue === pendingAppointmentValue) {
        g_form.setVisible(dateFieldName, true);
    } else {
        g_form.setValue(dateFieldName, ''); // Clear the date field when not in use
        g_form.setVisible(dateFieldName, false);
    }
}

Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi