Agent Help With Evaluate and @BusinessDays

105 pts.
Tags:
Lotus Agents
Lotus Domino
Lotus Script
I have an issue seeing how I should do this. The problem I am having is that I am using LotusScript and when I do this function in a field it works and produces how long the between days.

 @If(Status="90"; ((DateS90-DateCreated)/86400)+1; ((@Today-DateCreated)/86400)+1 )

but the problem with this is that is keeps searching and it is running really slow. I was told to make an agent with an Evaluate function using @businessdays in there. I need create an agent that will get me how many days old field. I need to improve this agent to get it to loop through my view I have and calculate the days between (DateCreated and DateClosed) sometimes they are not closed yet so they would need to use today's date and the date created to get the days in between. So this is what I have so far.... I need Ideas of where to go from here

ps. my field is set to computed when composed and is called daysold

Sub Initialize

Dim DSO As Variant

Set s = New NotesSession

 Set db = s.CurrentDatabase

Set view = db.GetView("SARs Report")

 Set doc = view.getfirstdocument

While Not doc Is Nothing

DSO = Evaluate(|@BusinessDays(DateCreated; DateS90)|,doc)

Set doc = view.GetNextDocument(doc)

Wend

End Sub

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 2  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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Brooklynegg
    This looks good so far. What values are you getting for DSO(0)? You don't actually describe the problem you are having. You just gave us the requirements. Also, I don't see any error handling in any of the code snippets. I am assuming you are doing it, but left error handling out of the code examples for clarity.
    3,845 pointsBadges:
    report
  • AMcAuley3
    [...] Agent Help With Evaluate and @BusinessDays [...]
    0 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following