3 Complex use cases of Script Include (Part 2)

Поділитися
Вставка
  • Опубліковано 15 вер 2024

КОМЕНТАРІ • 18

  • @sudipasamanta1502
    @sudipasamanta1502 8 місяців тому

    Great 👍 informative video Sir😊, we need more use cases videos like this so that we can improve our scripting skill day by day. Thank you.

    • @techwithpri
      @techwithpri  8 місяців тому +1

      You are welcome!!
      In this servicenow developer series you would find more use case videos on business rules,client script, script include and UI Actions which is already uploaded.
      For more complex use case please join my channel, I would start posting complex use case videos starting from this month.
      Keep watching and keep learning 👍

  • @ferozkasim328
    @ferozkasim328 7 місяців тому

    Thank you

    • @techwithpri
      @techwithpri  7 місяців тому

      You welcome !!
      Keep watching and keep learning 👍👍

  • @abidjaffrey5786
    @abidjaffrey5786 3 місяці тому

    Hey Pritam
    thanks for the amazing content.
    I'm facing issues when we are using the setvalue with JSON function the code seems correct but the value is not updating in assigned. i face the same problem in the 'Return multiple objects from script include' video as well, please help me how can i fix this

    • @techwithpri
      @techwithpri  3 місяці тому

      Hey 👋
      Can you possibly share the code you are using for client script and script include here in chat so that I can check and guide you further 🤓

  • @kuldippatil2006
    @kuldippatil2006 2 місяці тому

    Sometimes assigned to value not getting set, even after we are getting sysId of user. Tried alert for the sys id of user. Probably it could be cache issue

    • @techwithpri
      @techwithpri  2 місяці тому

      Yes it sould's like that only !! Try again and let me know 🤓

  • @rameshrms4431
    @rameshrms4431 8 місяців тому

    Thank you so much Pritham 🙏 please do more videos on integration as well.

  • @avia-rw6cy
    @avia-rw6cy 4 місяці тому

    Hello Sir, requesting you to please add some script include scenarios which are used in catalog client scripts and development of catalog items.....

    • @techwithpri
      @techwithpri  4 місяці тому

      Hey 👋
      Thank you for your comment !!
      I will surely do that in my complex use case video for ServiceNow.
      To get access on more use case join my channel now - ua-cam.com/channels/q9dV0PMEdQFzD4JTCNfK3A.htmljoin

  • @noor-ul-ainatta802
    @noor-ul-ainatta802 8 місяців тому

    I am practicing it and to me it is returning the last member of each group, How to tackle it now? I have refreshed as well but didn't work.

    • @techwithpri
      @techwithpri  8 місяців тому

      Hey..!!
      That's strange..🤔🤔
      Can you share your method from script include and client script here..?

    • @noor-ul-ainatta802
      @noor-ul-ainatta802 7 місяців тому

      ​ @techwithpri
      Method:
      assignrandom:function(){
      var usersobj={};
      var fetchuser=[];
      var grr=new GlideRecord('sys_user_grmember');
      grr.addQuery('group',this.getParameter('sysparm_group_user'));
      grr.query();
      while(grr.next())
      {
      usersobj.sys_id=grr.user.toString();
      fetchuser.push(usersobj);
      }
      return JSON.stringify(fetchuser);
      },
      type: 'GroupMmbersCount'
      });
      Client Script:
      var ga2=new GlideAjax('GroupMmbersCount');
      ga2.addParam('sysparm_name','assignrandom');
      ga2.addParam('sysparm_group_user',g_form.getValue('assignment_group'));
      ga2.getXMLAnswer(assignToRandom);
      function assignToRandom(response2){
      var obj=JSON.parse(response2);
      if(obj.length>0){
      var random = Math.floor(Math.random()*obj.length);
      g_form.setValue('assigned_to', obj[random].sys_id);
      }
      else{
      g_form.setValue('assigned_to','');
      }
      }

    • @techwithpri
      @techwithpri  7 місяців тому

      The code seems ok and also it is picking up random user from the group.
      Try a group which has 7-8 members and let me know what is the outcome.