We help IT Professionals succeed at work.

Triggers a notification if TotalDays is ..

ninteen83
ninteen83 asked
on
333 Views
Last Modified: 2013-12-18
hi Experts

I have a form called Employee with the following fields.

Empno      Text
Name      Text
HireDate      Date/Time
TotalDays      Number      Computed
            Due:=@Abs(@Integer((HireDate -ToDate) / (60 * 60 * 24)));
            @If(HireDate="";0;Due)

I have created some documents and TotalDays works fine. Returns 1 if HireDate is 04/10/2004

I've created a view for Employee form. View is called Employee View | EMPV.

In the view, I've created columns for all the 4 fields. If I create a document, the view displays Empno, Name, HireDate but does not display the TotalDays. I struggled for a long time but couldn't get the solution. :(

Actually I need this view when an employee completes 1 month. Means when 30 appears in the TotalDays of the view, an agent triggers a notification to someone.

Or anyone has any other way to send a notification if the totaldays is 30. ??
Comment
Watch Question

Bozzie4IT Architect

Commented:
What is ToDate ?

I don't understand what you are doing : is TotalDays a fixed number, or is it meant to change every day ('countdown') ?

Tom

Author

Commented:
ToDate   is   Date/Time,   Computed,   @Today
Sjef BosmanGroupware Consultant
CERTIFIED EXPERT

Commented:
If you check the Document Properties, is the correct value for TotalDays in the Document? Do you have validation checks in the date fields, using @IsTime()?

Author

Commented:
Sorry Dear .. I didn't get your 1st point. I'm not using any validation in the date fields. TotalDays returns number and everyday it changes because of ToDate. In all the documents it works/appears but it does not appear in the view.
Sjef BosmanGroupware Consultant
CERTIFIED EXPERT

Commented:
Eh? "... everyday it (TotalDays) changes ..."? Documents don't change by themselves. Only a person, either directly or by means of an agent, can change a document. Storing TotalDays is therefore more or less pointless, just like ToDate for it will contain the date when the document is last saved.

In the view, the number of days should be recomputed every time the view is reopened. This makes it a time-consuming view. You might better store the date of the next milestone in the document, and make a view sorted ascending on the milestone date. You can make an agent that walks through the first few documents of that view every day. The documents with a milestone that lies today or before today should be dealt with, and they should be given a new milestone date. The others will be handled automatically the next day.

About my first point: open the view with the documents, DON'T open the document but type Alt-Enter (or click File/Document Properties), the Properties box will open, go to the second tab, and find the TotalDays item there. At the right you can find its value. What is it?

Commented:
When you open the document, do u see the value in TotalDays. If yes then you should be seeing the value in view also. Also, if you want u can store the 30 days from the HIREdate in one field when the document is created and check ur agent against this date, so that u can minimize the calcualtion

Hope i am clear here

Partha
Use your formula in the TotalDays with little modification the TotalDays column

          @If(HireDate="";0; @Abs(@Integer((HireDate -@Today) / (60 * 60 * 24))) )

~Hemanth

 

Author

Commented:
sjef bosman

I have gone through the Document Properties from the view. All Fields are there except TotalDays .. :( yes TotalDays doesn't appear in the Document Properties if I open it from the view ..

Author

Commented:
p partha

it doesn't appear in the view at all .. you can check it from the following link

http://members.fortunecity.com/nadirshah/img2/notes.gif
Sjef BosmanGroupware Consultant
CERTIFIED EXPERT

Commented:
If, as you say, TotalDays is NOT in the Document Properties as a field, AND the field appears in the form, AND it is really the same form you are using, then the field MUST be on the form as Computed for Display.

What about my other suggestion, did you try that?? The milestone-date stuff?

I checked the link, there's nothing there except for a nice gif. You have a more interesting URL? ;)

Sjef
IT Architect
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Bozzie ! I have tried the exact what you suggested  .. but no luck :( .. TotalDays still doesn't appear in the view. I've changed TotalDays' type from Computed to Computed for Display, Computed when Composed even to Editable .. it works .. but doesn't appear in the view ...
Bozzie4IT Architect

Commented:
When you change the type, you must run the agent to set the field values.  You can check if the TotalDays field is set, by using the Document Properties (ALT-Enter, and look to the field values).

cheers,

Tom

Author

Commented:
Now the totaldays is appearing in the view ..

Thanks Bozzie .. Thank you all guys ..
Sjef BosmanGroupware Consultant
CERTIFIED EXPERT

Commented:
As Tom said earlier, your design still doesn't make much sense. There are many roads from A to B, but you're taking a short-cut you'll be regretting some day. I think you "jumped to a solution" without analysing the requirements completely. The fact that you ignored my well-meant remarks is understandable but it indicates to me that you're not thinking ahead. You're solving your current problem without realizing that you created future issues.

If I'm way off, pray forgive me, but if you'd like to discuss this further I'm happy to do so.

Sjef :)

Author

Commented:
SJef !

I was looking for a quick and easy solution. Ofcourse my design still doesn't make sense. A document doesn't change by itself. I really appreciate your efforts to solve this problem.

The problem is that I'm new to Lotus Notes therefore I couldn't get what was suggested by you. :O and I couldn't ask you to describe it step by step. :'(


Sincerely.
Sjef BosmanGroupware Consultant
CERTIFIED EXPERT

Commented:
ninteen83,

> and I couldn't ask you to describe it step by step

Why not? Just the fact that you're new to Notes should be the most important motive to ask almost anything! That is, if you intend to learn a lot. You know these sayings:
1. "There are no stupid questions, only stupid answers"
2. "There's never time to do it right, but there is always time to do it over".

Do think of your design in you spare time, and don't hesitate to ask questions!

Sjef :)
Sjef BosmanGroupware Consultant
CERTIFIED EXPERT

Commented:
Bozzie4IT Architect

Commented:
"There are no stupid questions, only stupid people" :-)

Tom
Sjef BosmanGroupware Consultant
CERTIFIED EXPERT

Commented:
LOL
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.