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] problem

Featured Replies

  • Newbies

I am trying to make a list, where I color code the different lines based on a deadline date. I am using this If-Statement:

[FMP-rangesize] jobber ble funnet:</font><br>

<hr>

<br>

[FMP-CurrentSort][/FMP-CurrentSort]

[FMP-record]

[FMP-If: Field:deadline.lt.CurrentDate]<font face="Arial, Helvetica, sans-serif" size="1" color="#006600">

[FMP-Else]

<font face="Arial, Helvetica, sans-serif" size="1" color="#FF0000">[/FMP-If]

<a href="[FMP-linkrecid: layout=bestill jobb, format=flow/Detail.html]">[FMP-field: Oppgave]</a> bestilt av [FMP-field: Oppdragsgiver_navn] den [FMP-field: Oppgave_innmeldt] med deadline [FMP-field: deadline]</font>

<br>

<hr>

<br>

[/FMP-record]

This does not work, the lines are green no mather what mad.gif The whole point was to get the expired lines red.

I also tried putting the if statement inside the <font> tag.

Anybody that knows what I am doing wrong?

These forums are filled with information. Most questions have been answered already. Research is good for the soul.

In the cdml forums do a little research. Look for a thread like "Changing text color based on content... "

Kjartan,

I think the problem exists because the CurrentDate is returning a text string. Hence, the .lt. is really not effective as you would expect for comparing dates.

I would use a calculated field to set a condition; e.g.

code:


deadline_flag: If(deadline < Status(CurrentDate),"expired","ok")

Hence, the cdml becomes:

[FMP-Record]

[FMP-If: Field:deadline_flag.eq.expired]<font face="Arial, Helvetica, sans-serif" size="1" color="#006600">

[FMP-Else]

<font face="Arial, Helvetica, sans-serif" size="1" color="#FF0000">[/FMP-If]

<a href="[FMP-linkrecid: layout=bestill jobb, format=flow/Detail.html]">[FMP-field: Oppgave]</a> bestilt av [FMP-field: Oppdragsgiver_navn] den [FMP-field: Oppgave_innmeldt] med deadline [FMP-field: deadline]</font>

<br>

<hr>

<br>

[/FMP-record]

Hope this helps.

Garry

[ February 28, 2002, 02:13 PM: Message edited by: Garry Claridge ]

Garry writes, "Hence, the .lt. is really not effective as you would expect for comparing dates."

If you will examine the two recent threads with "currentdate" in the subject line (one started by Turansky, one by me) you will notice that I advise against using the cdml tags -op and -lop and their related parameters in action links and form actions. In fact I posted code which allows one to do a search (db find) using the symbols of the db. I also strongly recommend reading the two articles on an exact search which I believe I cite there. I know I've cited those articles more than once a month over the past year. It took me six weeks to serendipitously find those references. They are very valuable to understanding. Understanding those two articles will help you understand the other symbols. Using these symbols one can effectively do a find of less than or greater than a currentdate, provided the dates are formatted correctly, as I so adequately demonstrated. The only additional field you will need [being in Oslo] is one which states the date formatting to the American date formatting which is the formatting FMPro uses in the "currentdate" schemata. That is the field upon which to operate. The one which agrees with the program's quirks.

In order to use the .lt., .gt., etc. parameters in If conditionals on format files, at least two requirements must be met.

1. The proper action first has been applied to the db.

2. You are using the If conditional parameters correctly.

The latter can be answered by the CDML Reference database.

There are no easy answers. Research is good for the soul.

[ February 28, 2002, 04:13 PM: Message edited by: Keith M. Davie ]

  • Author
  • Newbies

Thank you Garry smile.gif

Your solution did the trick. I have to say that CDML is fun and frustrating at the same time.

Kjartan

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.