Forum Discussion

googleid_118035's avatar
googleid_118035
Contributor
11 years ago
Solved

Cant we give partial of that message to check whether its occurred or not?

Hi All,



Currently i am using onlogerror event handler as below.

--------------------------


function GeneralEvents_OnLogError(Sender, LogParams){


   if (LogParams.MessageText == "The object does not exist. See Additional Information for details."){


    Log.Message("its object not found error message!");


  }


  else {


    Log.Message("its something else.")


  }


}

-------------------------


My issue is, Instead of giving entire error message, cant we give partial of that message to check whether its occured or not?


 


Ex;


Now I have to give "The object does not exist. See Additional Information for details.", to check whether its object not found error or not.


 


How about giving only "object does not exist".





...............

Thanks

Dev




  • Hi I think You are looking for somthing like this




    function GeneralEvents_OnLogError(Sender, LogParams){


    var erorStr = 'My own text.. ';


     


      if (LogParams.MessageText.indexOf('object does not exist')>-1) {


          LogParams.MessageText = erorStr ;


         // LogParams.FontColor = clMaroon;


     


      }


    }



    indexOf  is j-script, selecting string within string

    /Jaya-wewa (cheers)

     

1 Reply

  • NisHera's avatar
    NisHera
    Valued Contributor
    Hi I think You are looking for somthing like this




    function GeneralEvents_OnLogError(Sender, LogParams){


    var erorStr = 'My own text.. ';


     


      if (LogParams.MessageText.indexOf('object does not exist')>-1) {


          LogParams.MessageText = erorStr ;


         // LogParams.FontColor = clMaroon;


     


      }


    }



    indexOf  is j-script, selecting string within string

    /Jaya-wewa (cheers)