September 2, 200223 yr Hi I have a CDML page with an If/Else statement on that always results in the first case being seen as true regardless of what I compare it to! The field (includeimage) is a calculation field which either contains No or Yes. Simplified, the CDML looks like this: [FMP-IF:Field:includeimage.eq.Yes] Yes [FMP-ELSE] No [/FMP-IF] : [FMP-FIELD:includeimage] I added the [FMP-FIELD:includeimage] tag so I could compare what the if statement responded to with what is in the field. Whether the Field was Yes or No though, the If statement always printed the Yes. Even when I changed it to a value which isn't in any of the records being searched: [FMP-IF:Field:includeimage.eq.xzxzxzxzxz] I have used If statements before with no trouble. Any idea why this isn't working? I am completely dumbfounded. VS
September 2, 200223 yr [FMP-IF:includeimage.eq.Yes] Yes [FMP-ELSE] No [/FMP-IF] : [FMP-FIELD:includeimage] Try the above. You will note the absence of "Field: " following fmp-if: "The fieldis a calculation field which either contains No or Yes." If you are using this calculation field (includeimage) to determine if another field contains data you might consider not using the calc. field but referencing directly the field the calc is based upon (e.g. a field named "image"). In which case your code might look like: [fmp-if: image .ncn. ""] Yes [fmp-else] No [/fmp-if] And if you are planning on serving an image, you might want to check out the Sample File which I have offered on serving images. Storing them in FileMaker is not a great idea.
September 3, 200223 yr Author Thanks Keith The workaround you gave me with [fmp-if: image .ncn. ""] works fine. I am still confused why on this page the standard if statements doesn't work. Surely workarounds shouldn't be necessary when employing simple syntax. I'm not using Filemaker to hold image, just their filenames. Could this be something to do with the way I have written the calculation field perhaps? In any case, thanks for helping me get my page working, VS
Create an account or sign in to comment