12 Replies Latest reply: Jul 29, 2011 1:18 AM by Srinivasa D RSS

    ScriptErrorDetails

    Srinivasa D

      Hi,

       

      My script as  bellow..

      Test:
      LOAD
      @1,
           @2
      FROM
      U:\QlikView\Monitor Dashboard\Email Notification Test\Email test 0720\Email test 0721\test.txt.txt
      (txt, codepage is 1252, no labels, delimiter is '\t', msq);

      vErrorType=ScriptError;

      vErrordetail=ScriptErrorDetails;//Pls check latter for Value not assigning  properly


      vErrordetail=ScriptErrorList ;

       

       

       

       

       

       

       

       


      if ScriptErrorCount=0 then  //If Script Executed successfully!
      //set vError=0;

      Store Test into U:\QlikView\Monitor Dashboard\Email Notification Test\Email test 0720\Email test 0721\Error.qvd;

      ELSE //If Script not executed successfully!

       

      Set  vError=1;
      exit script;
      end if

       

       

       

       

       

       

       

       

       

       

       

       

       

       

       

      Above script  im not able access this inside vb script  as ScriptErrorDetails value become null.. how i can store this value in variable so i can  call this in macro..

      Macro Vb script as bellow for call that Error

      Set vErrType=ActiveDocument.Variables("vErrordetail")

      Thanks in advance.

       

        • ScriptErrorDetails
          Kaushik Solanki

          Hi,

           

             ScriptErrorDetail itself is a variable so no need to create any seperate variable to store the error.

           

             to see the value of this variable

           

             Create a textbox and type =ScriptErrorDetail.

           

             So is there is any error while loading the script the description is stored in this variable.

           

          Regards,

          Kaushik Solanki

            • Re: ScriptErrorDetails
              Srinivasa D

              Hi Kaushik,

               

              Thaks for your reply. i

              agree with you but in my case i need to send error deatils in mail. so need to call ScriptErrorDetail vbscript..in Qv 10 im loosing value .. so i cant able call ScriptErrorDetail  inside vb script..

              well-come your any other suggestion.  thanks

                • ScriptErrorDetails
                  Kaushik Solanki

                  Hi,

                   

                     If you want to send mail when error occurs, you can try this.

                   

                     Create a alert, here give condition as if (ScriptErrorCount<> 0,1,0)

                   

                     This will trigger the mail when there is error.

                   

                     Configure the mail.

                   

                     in message you can write

                   

                     =ScriptErrorDetail

                   

                     For more info on alerts have a look at the help.

                   

                  Regards,

                  Kaushik Solanki

                    • Re: ScriptErrorDetails
                      Srinivasa D

                      hey thanks for your suggestion but i wantedcall this error in Vbscript .pls help me

                        • ScriptErrorDetails
                          Srinivasa D

                          can u able to run my scipt?

                            • ScriptErrorDetails
                              Kaushik Solanki

                              Hi,

                               

                                 First thing i want to tell you is that qlikview already said that its not fixed that always your macro will run.

                               

                                 So it is always recommended  to use the built in feature of qlikview.

                               

                                 For macro you said.

                               

                                 "Macro Vb script as bellow for call that Error"

                               

                                 What do you mean by this.

                               

                              Regards,

                              Kaushik Solanki

                                • ScriptErrorDetails
                                  Srinivasa D

                                  Hi Kaushik,

                                   

                                   

                                  Thanks for your valuable suggestion

                                   

                                  I mean  i have Etl Script as bellow

                                   

                                  Test:
                                  LOAD
                                  @1,
                                       @2
                                  FROM
                                  U:\QlikView\Monitor Dashboard\Email Notification Test\Email test 0720\Email test 0721\test.txt.txt
                                  (txt, codepage is 1252, no labels, delimiter is '\t', msq);

                                   

                                  vErrorType=ScriptError;

                                   

                                  vErrordetail=ScriptErrorDetails;//Pls check latter for Value not assigning  properly


                                  vErrordetail=ScriptErrorList ;

                                   

                                   

                                  if ScriptErrorCount=0 then  //If Script Executed successfully!
                                  //set vError=0;

                                  Store Test into U:\QlikView\Monitor Dashboard\Email Notification Test\Email test 0720\Email test 0721\Error.qvd;

                                  ELSE //If Script not executed successfully!

                                   

                                  Set  vError=1;
                                  exit script;
                                  end if

                                   

                                  =============================MACRO========

                                  in macro im calling  vErrordetail as bellow

                                   

                                  Set vErrDt=ActiveDocument.Variables("vErrordetail")

                                  'MsgBox(vErrDt)

                                  but vErrDt dint have any value as  i lost value of vErrordetail in Etlscript itslef

                                  i found reson that i had defined ScriptError and assigined to  vErrorType  vaiable after that lost.if its single variable vErrordetail it will store value.and i can call this in MACRO aslo.

                                  thank u

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                   

                                    • ScriptErrorDetails
                                      Kaushik Solanki

                                      Hi,

                                       

                                         This is a reviced version of your script.

                                       

                                        

                                      Test:
                                      LOAD
                                      @1,
                                           @2
                                      FROM
                                      U:\QlikView\Monitor Dashboard\Email Notification Test\Email test 0720\Email test 0721\test.txt.txt
                                      (txt, codepage is 1252, no labels, delimiter is '\t', msq);

                                       

                                      if ScriptErrorCount=0 then  //If Script Executed successfully!
                                      //set vError=0;

                                      Store Test into U:\QlikView\Monitor Dashboard\Email Notification Test\Email test 0720\Email test 0721\Error.qvd;

                                      ELSE //If Script not executed successfully!

                                       

                                      Set  vError=1;
                                      exit script;
                                      end if

                                       

                                       

                                      Now as i can see in your macro, it seems that you just want to display the error.. is it...?

                                       

                                      If yes then create a alert which will show you the error.

                                       

                                      This way you will achieve what you want and there will be no need of any macro.

                                       

                                      So as i said ScriptErrorList contains the error and its a variable, so you dont need any other variable for that pourpose. If you want you can directly call tyhis variable in macro. like this.

                                       

                                      Set vErrDt=ActiveDocument.Variables("ScriptErrorList")

                                      MsgBox(vErrDt.getcontent.string)

                                       

                                       

                                      Regards,

                                      Kaushik Solanki