Page 1 of 1
How to do portals
Posted:
Thu Jan 10, 2013 8:39 am
by JaseFace
How can I create portal type data in fmSpark. I'm sending quotes (which have the details of the contacts looked up from the relevant tables) but my quotes have Items and I need to display them on the quote.
Maybe I'm missing something simple...
Re: How to do portals
Posted:
Thu Jan 10, 2013 2:25 pm
by John Sindelar
Hi,
Anything between the << and >> will be evaluated as a FileMaker function. So while you can't put a portal in an email, you can put a return delimited list of data using the List() function. So in an invoices file, something like
<<List ( InvoiceLineItems::ItemName >>
would show a list of the item names if your related table (the table occurrence you'd base your portal on) was called InvoiceLineItems.
If you haven't used the List() function before look it up in FileMaker's built-in help. It's pretty cool! And while it can only take one field as its parameter, you can create a calc in your portal table that returns the whole "line" you'd like to see in your mail. So in our invoice lines example, you might create a field called "item display" defined as
ItemName & " " & ItemQuantity & " " & "$" & Round ( ItemPrice ; 2 )
Then using that field in List, like
<<List ( InvoiceLineItems::item display>>
would get you something that looks more like a portal.
Hope that helps,
John
Re: How to do portals
Posted:
Fri Apr 19, 2013 7:10 am
by JaseFace
Hi,
I'm using this method pretty well, but am unable to put concatenated strings with line breaks in them
¶ isn't respected by the HTML conversion process, and of course using a real line carriage return isn't respected by FM. My line items are more than one line, e.g.:
3 * Prod1 @ $0.01 = $0.03
This Product has a description
This Product has Date and location Info
This Product has a URL
7 * Prod 2 @ .....
Any ideas how I'll be able to get my line breaks in?
Regards
Jason
Re: How to do portals
Posted:
Tue Apr 23, 2013 11:59 am
by JasonYoung
Hi Jason,
So there's two areas in FMSpark for text, the Plain Text option and the the HTML Regions. For the Plain Text option, ¶ should work fine, but for the HTML part use <br/>. See below:
- TextForHTML.png (158.95 KiB) Viewed 24603 times
- Preview.png (85.91 KiB) Viewed 24603 times
Let me know if that helps,
-Jason
Re: How to do portals
Posted:
Fri Apr 26, 2013 6:36 am
by JaseFace
In case anyone is following this thread, Jason very helpfully provided the answer off-line.
Use the FM Substitute function to replace the unsupported '¶' character with the appropriate HTML code for a line break.
<<Substitute ( List (ChildTable::ConcatenatedField) ; ¶ ; "<br/>" )>>
Thanks Jason
PS this also works great with the TextStyleAdd function to enbolden, underline or otherwise add some kind of formatting to the HTML code pulled in from the FM field.