Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

FMP-if and CurrentDate

Featured Replies

I would like to display a date on a page in red if the job is incomplete and the due date is passed the current date. Here's my code.

[FMP-If: Field:due_date .gt. CurrentDate]

[FMP-If: Field:status .neq. done]

<td><font face="verdana,arial,helvetica" size=1 color=FF0000>[FMP-Field: due_date] </font></td>

[/FMP-If]

[FMP-Else]

<td><font face="verdana,arial,helvetica" size=1>[FMP-Field: due_date] </font></td>

[/FMP-If]

Doesn't seem to work. Any ideas?

You need to SIMPLIFY. smile.gif" border="0

[FMP-If: Field:status .neq. done]

<td><font face="verdana,arial,helvetica" size="1: color="#FF0000">[FMP-Field: due_date]</font></td>

[FMP-Else]

<td><font face="verdana,arial,helvetica" size="1">[FMP-Field: due_date] </font></td>

[/FMP-If]

Peace

Keith

[ April 06, 2001: Message edited by: Keith M. Davie ]

  • Author

But that won't do what I'm looking for. Your code would make everything marked done black and everything else red.

I'm trying to flag items that are not complete or "done" and their due date has been passed. So if the due date is 10 April and the status is incomplete, on 14 April the date will display black but on 9 April it will be red. If the status is "done" the date will display black no matter what the date is.

Hope this makes more sense.

Thanks Keith.

Did you then try the reverse order of <td> lines:

[FMP-If: Field:status .neq. done]

<td><font face="verdana,arial,helvetica" size="1">[FMP-Field: due_date] </font></td>

[FMP-Else]

<td><font face="verdana,arial,helvetica" size="1: color="#FF0000">[FMP-Field: due_date]</font></td>

[/FMP-If]

or changing the parameter:

[FMP-If: Field:status .eq. done]

<td><font face="verdana,arial,helvetica" size="1: color="#FF0000">[FMP-Field: due_date]</font></td>

[FMP-Else]

<td><font face="verdana,arial,helvetica" size="1">[FMP-Field: due_date] </font></td>

[/FMP-If]

Peace

Keith

  • Author

Maybe I'm missing something. Isn't your code checking the status only? I need to check the status and the date relative to the date the page is displayed.

"I'm trying to flag items that are not complete or "done" and their due date has been passed."

Ah, I missed that. Yes, the code I was suggesting would show the due date of a job which was "in process" in red, otherwise the job's due date would be in black since we are really checking the status of the jobs in order to flag the due date by color. Now this color condition will be true whether today is (1) before the due date, (2) the due date or (3) past the due date.

If the field status does not equal "done"

display the data in field duedate in red

else (the job is done)

display the data in field duedate in black

end-if

Why would you want to show the status of a job in progress in black just because today is prior to the due date? If shown in black by that date condition, won't someone think the status is complete and therefore does not need to be worked on?

If what you really want to check are just those jobs which are past due and incomplete, then you need to do a search for just those records using those criteria - a totally different process.

You need to identify the actual goal you are attempting to achieve.

Peace

Keith

  • Author

All I'm tying to do is flag jobs incomplete and passed their due date.

The only part that doesn't seem to work is this code;

[FMP-If: Field:due_date .gt. CurrentDate]

I got it to work using another approach but it required an additional calculation field which displays a 1 if the due date is less then today and a 0 if not.

Then I used this code;

[FMP-If: Field tongue.gif" border="0ast_due .eq. 1]

[FMP-If: Field:status .neq. done]

<td><font face="verdana,arial,helvetica" size=1 color=FF0000>[FMP-Field: due_date] </font></td>

[/FMP-If]

[FMP-Else]

<td><font face="verdana,arial,helvetica" size=1>[FMP-Field: due_date] </font></td>

[/FMP-If]

Works fine but I don't like having to add an additional field to the database.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.