Object variable not set while agent is running

55 pts.
Tags:
Lotus Notes
LotusScript
The daily agent unable to running successfully. In the server log i found that it say [22151272:00002-00001] 07/13/2017 10:04:46 AMgr: Agent ('Process Time Attendance Only' in 'Smartcard Attendance/sas-server.nsf') printing: Got error Object variable not set on line 124 And below is what it set in line "124" ExcludeHoliday=False How to solve this error.? Please help since I'm a beginner in Lotus scripts. Thank you. -lotusscriptbeginner-

Software/Hardware used:
LotusNotes Script

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Stiletto

    Assuming this is the same code from the other thread...

    I don't think line 124 is the line you think it is - LotusScript can sometimes count lines differently than your editor counts them.  Anyway, in that general vicinity of the code, you have 2 lines:

     ldte=DateValue(AdjustedDate(timedoc.TstaffID(0), tdte, ApprPrd, ExcludeOffday, ExcludeHoliday))
                mdte=DateValue(AdjustedDate(timedoc.TstaffID(0), tdte, MvePrd, ExcludeOffday, ExcludeHoliday))


    What is "AdjustedDate"? I don't have a full reference guide in front of me, but it doesn't seem to be a LS function. Is it a custom function of your own design?

    5,490 pointsBadges:
    report
  • paulinebgg2500
    I tried to run the agent in debug mode. But it ended not responding if i use the "continue" button in the debug console. Or i use it in the wrong way?

    The script is fully generated by other programmer and not me. I believe "AdjustedDate" is the ammended date in the database.

    Are the any way that how i can run this agent in debug mode to identify the data that might cause the agent unsuccesfully running? I afraid its not because of the script itself but maybe because of the incomplete database that its calling to running the agent.

    Sorry. It's just my beginner assumption. :D
    55 pointsBadges:
    report
  • Stiletto

    Given the way AdjustedDate is being used, it really looks like a function with 5 distinct parameters being passed to it.

    As for the debugger, use the button labeled something like "Step Into".  That will let you step through the code line-by-line.  There is a tab in the bottom pane that will show you the value of every variable as you do this.

    5,490 pointsBadges:
    report
  • paulinebgg2500
    So the error line will show in the variables box is it? (lower box) or in debug console (upper box with yellow error). I tried to run it but can't until finish since the coding take too long to finished as I has other task on progress to be done. Will continue it today.

    It will be so good if i can let it run auto by using "continue" but can't. so i have to use click the "step into". Hope I can figure it by this step. Thank you to you.
    55 pointsBadges:
    report
  • paulinebgg2500
    This is the result in "Output" console while i run the debug. May i know how to locate which variant is not set? I have tried to look in the "Variable" console but i failed to identify which one.

    Agent:Process Time Attendance Only started running at 7/24/2017,9:01:23 AM
    Got error Entry is no longer in view: (Time Attendance Maintenance By StaffID & Date) on line 63
    Got error Object variable not set on line 124
    Got error Object variable not set on line 124
    55 pointsBadges:
    report
  • Stiletto

    Okay, first let's deal with the debugger. You can set breakpoints in the code with the debugger. Then, when you hit continue, the code will run until it gets to a breakpoint. Then you can use the Step Into button to go line-by-line.

    Since the error shows the problem is with the view mentioned, I would set a breakpoint at this line:

    Set timeVw=db.getview("(Time Attendance Maintenance By StaffID & Date)")

    That will let all the code that appears before this point to run, and then let you step through the rest.

    5,490 pointsBadges:
    report
  • Stiletto

    I suspect that the problem is with these 5 lines:

    Set timeVc=timeVw.Allentries
        Set tobeDeleted=timeVw.Getalldocumentsbykey("", true)
        Call tobeDeleted.removeall(True)
        Set timeVe=timeVc.Getfirstentry()
        Do While Not (timeVe Is Nothing)

    The first line is getting a collection of all entries, and then the third line is deleting some of them. Notes/Domino has this weird thing with stubs that can cause issues.  I would try 1 (or both) of these approaches to see if it helps:

    1) Move the first line to be after the third line.  This way you aren't getting the collection of all entries until after you've deleted the other set of documents. Like this:

    Set tobeDeleted=timeVw.Getalldocumentsbykey("", true)
    Call tobeDeleted.removeall(True)
    Set timeVc=timeVw.Allentries

    Set timeVe=timeVc.Getfirstentry()
    Do While Not (timeVe Is Nothing)

    2) Do a check for IsValid (I think that's what it is, IIRC).  You'll want to look at the documentation, but it's something along the lines of

    If doc.IsValid Then

    This allows you to check for those weird zombie records.


    5,490 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: