#4 OnChange Client Script in ServiceNow | Client Scripts in ServiceNow

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ธ.ค. 2024

ความคิดเห็น • 16

  • @feel_good_songs
    @feel_good_songs 2 ปีที่แล้ว

    Awesome 👍👍👍👍

  • @hangtran652
    @hangtran652 3 ปีที่แล้ว

    Thank for your sharing!

  • @Rayan.Choukri
    @Rayan.Choukri 2 ปีที่แล้ว

    I have a variable called "Request type" that has two choices: "New_card_production" and "Modify_card." I also have a "Delivery date" variable. If the user selects "New_card_production," then the user should be forced to enter a date that is 180 days or more from the current date. If the user selects "Modify_card," then the user must enter a date that is 30 days or more from the current date.
    I have tried UI Policy and different client scripts/script include but nothing seems to work.
    Can you please share with me a working code or the best method to implement this?

  • @shivigariparamesh9213
    @shivigariparamesh9213 ปีที่แล้ว

    while selecting the onchange and onload ,onsubmit,oncelledit am unable to get a script function in script field(default function) . what will be the solution can you please suggest.

  • @crackerahul
    @crackerahul 3 ปีที่แล้ว +1

    Thanks for this !

  • @rohansen2775
    @rohansen2775 3 ปีที่แล้ว

    Thanks.. ❤️

  • @mydreamz98
    @mydreamz98 ปีที่แล้ว

    What is Isolate script in client scripts.Can you pls explain

  • @rushit_1997
    @rushit_1997 3 ปีที่แล้ว

    // Use case : Polulate assignment group "Yardi - ABF" if the the CI is "Yardi - ABF"
    function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
    return;
    }
    var ref = g_form.getReference('cmdb_ci');
    if (newValue == 'Yardi - ABF'){
    g_form.setValue('assignmnet_group','Yardi - ABF');
    }
    }
    i have written this script but isnt functioning well

    • @abhijeet3184
      @abhijeet3184 2 ปีที่แล้ว

      this is either bcoz of u r using the same value to set which is used in the if condition or bcoz the backend value is incorrect. please do let me know what was the issue if u got this resolved.

  • @ashartammar4073
    @ashartammar4073 ปีที่แล้ว

    Not the ideal use case for new record when changing the category

  • @earlyinvestor8221
    @earlyinvestor8221 3 ปีที่แล้ว

    Sir if i change the value from New to On Hold it works but if i again select other state like new or in progress, its still mandatory that's what i do not want , can u tell the code to avoid that. Thanks in Advance :)

    • @gayathriadoni7
      @gayathriadoni7 3 ปีที่แล้ว

      Same problem, can we rollback the worknotes field if we change the state to anyother field except onhold? Did u get the solution?

    • @phanich1317
      @phanich1317 2 ปีที่แล้ว

      @@gayathriadoni7faced the same issue as well and felt like might be an glitch in PDI

    • @roopaponnur8881
      @roopaponnur8881 2 ปีที่แล้ว

      Add an else condition with setMandatory of worknotes to false. It works

    • @Bhagwatgamepatil
      @Bhagwatgamepatil ปีที่แล้ว

      if (newValue == '3') {
      g_form.setMandatory('work_notes', true); }
      else {
      g_form.setMandatory('work_notes', false);
      }
      @@gayathriadoni7