Set field value false on outage form when change state is not in scheduled else true

raju51
Tera Contributor

I need to set outage form having active field to value true when Change request state changes to scheduled and set outage to active false when not in scheduled state.

6 REPLIES 6

omkar_jadhav_
Tera Contributor

Here's how to set the field value using a
Step-1)business rule:

  • Navigate to System Definition > Business Rules.
  • Click New.
  • Table: Select the table of your outage form (e.g., Incident).
  • Name: Give the rule a descriptive name (e.g., Set Outage Flag Based on State).
  • Advanced: Check this box.
  • Script: Paste the following script:
    omkar_jadhav__0-1710917661759.png

    Step-2) Use client script:

    • Navigate to System Definition > UI Page.
    • Open the form for your outage table.
    • Click the Client Scripts tab.
    • Click New.
    • Name: Give the script a descriptive name (e.g., Set Outage Flag on State Change).
    • Trigger: Select "onChange" of the "Change State" field.
    • Script: Paste the following script:
      omkar_jadhav__1-1710917877011.png

       

I have to set value of outage based on change request state "scheduled"

raju51
Tera Contributor

hi @omkar_jadhav_  I have custom field Active on outage form. It should be set false when change request is not in scheduled or changes from scheduled state. Active field is true only in scheduled state.

Harish KM
Kilo Patron
Kilo Patron

Hi @raju51 there is no active field in Outage, do you have any custom field created?

Regards
Harish