Question

i have a lotus application and have a page which has two links on it:

  1. Check-In
  2. Check-Out

both links open a attendance form for daily check-in and check-out..

once the user checks-in i want to hide the check-in link and only show up check-out link...

i have a field "Status" in attendance form which tells whether employee has checked in or checked out. How do i use that field in page hide-when formula to hide my link once its clicked?

Was it helpful?

Solution

First of all, the links must be in separate paragraphs so they can be separately controlled.

Secondly, you must have a view in which the first column is sorted and contains the username followed by the date from the fields in your daily attendance documents. E.g., it should be in a format like "Joe User/Org-01-01-12". The second column in the view should have the Status from the documents. For the sake of this answer, let's call that view "DailyAttendance".

Thirdly, you have three cases: the attendance document for the user on this day doesn't exist, it does exist and the Status is "Checked In", or it does exist and the status is "Checked Out". There might be a fourth case, where the document exists but the Status is neither "Checked In" nor "Checked Out", but your logic should probably try to avoid that and in any case I'm going to write the hide-when formulas so that both links will be hidden in that case.

Now, in most cases it's actually a little easier to think in terms of See-When instead of Hide-When so I'm going to re-state your requirements as See-Whens. Your See-WHen rules are:

  1. See the Check-In hotspot when the daily attendance document for the current user and current day does not exist.
  2. See the Check-Out hotspot when the daily attendance document exists for the current user and current day, and the Status field in the document is "Checked In".

To use see-when logic in a hide-when formula, you simply be write your formula based on see-when rules, and then put a logical not around it for the final result.

Your hide-when for the paragraph containing the "Check-In" hotspot will look like this:

key := @Name([CN];@Username) + "-" + @Text(@Today);
status := @DbLookup("Notes":"NoCache";"":"";"DailyAttendance";key;2);
notFound := @IsError(status);
seeWhen = notFound;
!(seeWHen);

Most expert Notes programmers would condense that into a shorter formula. I've left it in a step-by-step format to make it as obvious as possible.

Your hide-when for the the paragraph containing the "Check-Out" hotspot will look like this:

key := @Name([CN];@Username) + "-" + @Text(@Today);
status := @DbLookup("Notes":"NoCache";"":"";"DailyAttendance";key;2);
found := !(@IsError(status));
seeWhen = found & (status = "Checked In");
!(seeWhen)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top