Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Search.html --> Results.html with FMP-if statement


This topic is 7906 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

hello people!

I was wondering if anyone could help me with DMP-if syntax....here it is:

on Search page a I have form with a drop down list:

-----Search.html------------

<form name="form1" method="post" action="">

<select name="MYLIST" id="MYLIST">

<option value="TV" selected>TV</option>

<option value="AM">AM</option>

<option value="FM">FM</option>

</select>

<input type="hidden" name="-op" value="gte"> <input name="Date" type="text" id="Date" tabindex="9" size="15">

<input type="hidden" name="-op" value="lte"> <input name="Date" type="text" id="Date" tabindex="9" size="15">

</form>

------------------------

on the Results.html page I would like to use FMP-if statement that would generate this logic:

FMP-if: MYLIST .eq."TV"

but I am not sure of the syntax...what would be the right way to do/write this?

thank you again!

Posted

Hi Garry!

Here is a follow-up Q on something you advise some time ago...

how about if we have "All Listed" in the search form:

<option value="" selected>ALL Listed</option>

......

would it reflect as:

[FMP-Record]

[FMP-If: MYLIST.eq.""]

.......

thanx again

Posted

Better yet...let me just show the whole deal instead of asking you 1 question at the time. Here is my goal but the I do not know if this IS PSSIBLE .The code is stripped from HTML part.....:

Assuming that we have the same Search.html with an additional option for ALL Listed:

-----Search.html------------------------------------------

<form name="form1" method="post" action="/FMPro">

<select name="MYLIST" id="MYLIST">

<option value="" selected>ALL CATEGORIES</option>

<option value="TV" selected>TV</option>

<option value="AM">AM</option>

<option value="FM">FM</option>

</select>

</form>

-----------------------------------------------------------

I am attepmting to do this on Results.html:

-----Results.html------------------------------------------

[FMP-Record]

[FMP-If: MYLIST.eq.]

<!-- lets make separate Inlines for each CATEGORY -->

<!-- for TV -->

[FMP-InlineAction: -db="MYDB.fp5", -lay="MY_LAYOUT",CATEGORY="TV", -op=gte, Date={field:Date},-op=lte, Date={field:Date},-Find]

...[FMP-field: CATEGORY]

...[FMP-field: Total]

[/FMP-InlineAction]

<!-- for AM-->

[FMP-InlineAction: -db="MYDB.fp5", -lay="MY_LAYOUT",CATEGORY="AM", -op=gte, Date={field:Date},-op=lte, Date={field:Date},-Find]

...[FMP-field: CATEGORY]

...[FMP-field: Total]

[/FMP-InlineAction]

<!-- for FM -->

[FMP-InlineAction: -db="MYDB.fp5", -lay="MY_LAYOUT",CATEGORY="FM", -op=gte, Date={field:Date},-op=lte, Date={field:Date},-Find]

...[FMP-field: CATEGORY]

...[FMP-field: Total]

[/FMP-InlineAction]

[FMP-Else]

<!-- OR if each CATEGORY is selected by itslef -->

[FMP-InlineAction: -db="MYDB.fp5", -lay="MY_LAYOUT",CATEGORY={field:CATEGORY}, -op=gte, Date={field:Date},-op=lte, Date={field:Date},-Find]

...[FMP-field: CATEGORY]

...[FMP-field: Total]

[/FMP-InlineAction]

[/FMP-If]

[/FMP-Record]

-----------------------------------------------------------

I hope you are with me on this one smile.gif !

I am really new to CDML concepts but in theory this is as good as I can get. The answer might be simple... such as NOT POSSIBLE but.....I hope to get some feedback on this since it WILL resolve most of posts here...relationships..portals..value lists... all this could be eliminated laugh.gif

thanx Garry ( and You 2)!

Posted

You know what...as crazy as this looks it actually works excpet fot the effect of

[FMP-Record]

[FMP-If: MYLIST.eq.]

...

..

[/FMP-If]

[/FMP-Record]

the FMP-Record loops/displays FMP-Fields inside more than ones...

Is there a way to tweak it so it returns only the one- 1st record found?

[FMP-Record] <-- maybe SkipALL but the 1st here

[FMP-If: MYLIST.eq.]

THANX laugh.gif......this is getting exciting!

Posted

to keep this post alive:

is there a way to limit/return only one/1st record found if I have 5 Inlines inbetween IF statement:

[FMP-record]

[FMP-If:...

.....Inline -find

.....Inline2 -find

..

....inline5 -find

[/FMP-If:...

[/FMP-Record]

Basically I would like to have all the "Inline finds" to return their own finds but show only 1st record of its find!

How?

I tryed with each Inline and -Max but that does not effect it. Right now the results are returning:

-inline1 results record1.....

-inline1 results record2.....

-inline1 results record3.....

-inline2 results record1.....

-inline2 results record1.....

.....

-inline5 results record1.....

-inline5 results record2.....

My goal is:

-inline1 results record1.....

-inline2 results record1.....

-inline3 results record1.....

-inline4 results record1.....

-inline5 results record1.....

thank you people!

Posted

where???

in the Inline itslef?

I tryed but no effect what so ever. the problem seems/is that [FMP-Record] that lives on top of [FMP-if:MYLIST.eq.] and I have no limit on how many records it returns frown.gif

here is an inline used for manually typeing in AM,FM and TV categories:

[FMP-InlineAction: -db=MYDB.fp5,-lay=myLAY,CATEGORY="TV",-op=gte,Date={field:Date},-lo=lte,Date={field:Date},-Max=1,-Find]

and the "dynamic" one where category is slected individually:

[FMP-InlineAction: -db=MYDB.fp5,-lay=myLAY,CATEGORY={field:CATEGORY},-op=gte,Date={field:Date},-lo=lte,Date={field:Date},-Max=1,-Find]

where field "category" contins categories from MYLIST (sorry for reference as MYLIST...it's CATEGORY that I should have used for the drop-down-list name) and it is the name of the drop-down list

:x hmmmmmmmm

....so yeah, it doesn't work or I am probably looping my self

Posted

well.....I can't remove it then nothing gets displayed frown.gif

...slowly but surely I am giving UP on this inline crap...it just doesnt work....it was a long shot anyway!

thanx Garry

Posted

perhaps 5 inline actions can not be processed properly on the same file. Maybe making 1 file/location will solve the issue .... :| ?

we will see....thanx for the posts!!!!!

Posted

ok tryed that as well ( 5 files-5 actions NO NO NO) still the same problem when it comes to searching for -ALL Categories!

I also tryed removing the [FMP-Record][FMP-If:.....[/FMP-Record] that is "above" IF statements but then all I get is one line displayed which destroys my whole IF statement and none of the other categories are displayed but the random 1st one listed.

...well I hope some one learns from this long post....learn something other than to hate limitations of CMDL!

Sad day for Leb i Sol but happy day for YOU...if you read the post

noooobody knoooows...the trouuuuubles I'v seeeeeeen LOL smile.gif

Posted

Hmm, maybe it is the design.

I am doing pretty nice things in CDML and the limitations are far away.

You must remember, that you first develop the logic in FM. You are basically using the CDML just to SHOW what was done in FM. And that works rock solid.

On the other hand, if you need strong middleware with own processing capabilities, multithreading and scripting, go for Lasso or php.

Posted

Thanx Anatoli!

I know I know... I am really at the bottom of it all ( as far as understanding of FM and CDML) but I am lerning smile.gif .....hard or easy way.

Unfortunatelly, I am used to VBscript and some SQL which, as you know, can in reality take over the database structure and with the right script it is easier to do those "show" as well as the actions on DB....eg. flat DB will filter with SQL as if it was a related (the speed annd performace is antoher thing)....anyway thats a whole another deal.

I will try Garrys posts on topic "Filter Portatls on Date range" which again was initiated from my side.....I am still learning...I have to admit FM is really cool if it would just improve on some aspects I think it would become serious competition to MS Access,postgree etc...al those small-mid. plats

Anyhow, thank you guys any input hels especially if you a "virgin" AND virgo on top it smile.gif

This topic is 7906 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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