On Demand/Classless Script Include (with use case)

Поделиться
HTML-код
  • Опубликовано: 29 янв 2025

Комментарии • 23

  • @ayodelebolarin4881
    @ayodelebolarin4881 Год назад +1

    Hi. Thank you for making these videos. They are really helpful. I passed my CSA after watching your preparation series. I am a member.
    I have a quick question: how do you get the field names in blue to appear?

    • @techwithpri
      @techwithpri  Год назад

      Its my pleasure !😇😇
      Can you tell me the time of the video where you get this blue field names?😀😀
      I would happy to help you !!

    • @ayodelebolarin4881
      @ayodelebolarin4881 Год назад

      Thanks for your response. Around 6:33.
      E.g, the Parent Incident displays the parent_incident in blue.

    • @techwithpri
      @techwithpri  Год назад +1

      @@ayodelebolarin4881 I checked it .
      This is not something that I have applied externally..i think i selected that field and that's why it's showing or kind of highlighting..😄😄

  • @Kesavi-l7f
    @Kesavi-l7f Месяц назад

    Hii bro I am beginner 😅 when I configure and open business rule the incident table or current page is leave so what I do to open on new tab😅😊 work note is not update for me

    • @techwithpri
      @techwithpri  26 дней назад

      Hey 👋
      I did not understand the issue you are facing 😅
      Can you tell me again and share me the code as well 🤓

  • @niksawt1338
    @niksawt1338 13 дней назад

    With the help of this video i m practiced and trying to update work notes in problem from incident, but it won't work, i m following each and every step from video business rule and script include both are correct, so can u plz tell me how to solve this??

    • @techwithpri
      @techwithpri  13 дней назад

      Hey 👋
      Thats strange !
      Can you share me your code here ? both business rule and script include 🤓

    • @niksawt1338
      @niksawt1338 12 дней назад

      script include
      function updateWorkNotes(problem,workNotes){
        var gr = new GlideRecord('problem');
        gr.addQuery('sys_id',problemID);
        gr.query();
          if(gr.next()){
            gr.work_notes = workNotes;
            gr.update();
          }
      }
      business rule for script include
      (function executeRule(current, previous /*null when async*/) {
        var worknotes = current.work_notes.getJournalEntry(-1);
        updateWorkNotes(current.problem_id,worknotes);
      })(current, previous);

    • @niksawt1338
      @niksawt1338 12 дней назад

      Everytime this happened when i m trying to update incident it won't change anything in problem, can u please guide me how to solve this issue?

    • @techwithpri
      @techwithpri  9 дней назад

      Thanks for sharing !!
      Check first line of the code, it should be -
      function updateWorkNotes(problemID,workNotes)
      You are passing the the problem_id fields value from business rule and storing inside of problemID parameter.
      Then only this line will work - gr.addQuery('sys_id',problemID);
      I hope it clears now 🤓

  • @GillerlaRajesh
    @GillerlaRajesh 7 месяцев назад

    Hlo pritham,
    I got doubt here when u calling script include in server side i means in business rule side here
    U directly called function name right here.
    But syntax says that
    new scriptincludename(). function name(); right
    I too tried calling new script include name.function name but its not working,
    but i called using directly function name it will working fine
    Is there any specific criteria is there to call script include in server side ?
    I thinka as per my understanding only one way rigt.

    • @techwithpri
      @techwithpri  7 месяцев назад +1

      Hey 👋
      Thats a good finding !!
      Well understand the fundamental the classless script include can contain one function and the function name is same as the script include name.
      Thats why when you call the function it automatically calls the script include as name of the script include and function has to be same.
      You should use new keyword when you are calling function which is defined in create a new class script include as there the function name and script include name is different 🤓.

  • @abidjaffrey5786
    @abidjaffrey5786 8 месяцев назад

    Hi Pritam, I
    Could you help me if there is any error in the below, it is not executing.
    Script:
    function updateWorkNotes(problemID,workNotes){
    var gr = new GlideRecord('problem');
    gr.addQuery('sys_id',problemID);
    gr.query();{
    if(gr.next()){
    gr.work_notes = workNotes;
    gr.update();
    }
    }
    }
    BR:
    (function executeRule(current, previous /*null when async*/) {
    var workNotes = curerent.work_notes.getJournalEntry(-1);
    updateWorkNotes(current.problem_id,workNotes);
    })(current, previous);

    • @techwithpri
      @techwithpri  8 месяцев назад

      Hey 👋
      In which table you run the BR?

    • @GillerlaRajesh
      @GillerlaRajesh 7 месяцев назад

      In script include see u given flower brace after gr.query();
      Please remove that one and check

    • @devenbedase6246
      @devenbedase6246 6 месяцев назад

      In BR you made a spelling mistake while writing current.
      var workNotes = curerent.work_notes.getJournalEntry(-1);
      var workNotes = current.work_notes.getJournalEntry(-1);

  • @mohdhasim1332
    @mohdhasim1332 9 дней назад

    What is getJournalEntry

    • @techwithpri
      @techwithpri  9 дней назад

      Hey 👋
      getJournalEntry() is a method to get the journal field's value such as work notes, additional comments.
      You see in this specific use case I have shown you that how you can get the value of worknotes from incident table and then paste the same inside of associated problem record's work notes 🤓

  • @boldflash3728
    @boldflash3728 4 месяца назад

    code is not working for me

    • @techwithpri
      @techwithpri  4 месяца назад

      Hey 👋
      Share me the code here, which you are trying 🤓

  • @girimcd8361
    @girimcd8361 3 месяца назад

    var workNotes = current.work_notes.
    the getJournalEntry is not coming when enter dot after worknotes to select it. Please let me know

    • @techwithpri
      @techwithpri  3 месяца назад

      Hey 👋
      Sorry for the late reply 😔
      But did it work actually? the getJournalEntry?