105 pts.
 Agent Help With Evaluate and @BusinessDays
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



Software/Hardware used:
ASKED: October 21, 2010  1:48 PM
UPDATED: October 22, 2010  1:10 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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 pts.