|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Apprentice |
How do I do this? I want to get data from forms into a merged letter. Sometimes the data will be in the form of a checkbox- can I put checkboxes into letters? I have been searching and searching, but I have no idea of how to get data from form name "test form" into a merged letter. That "test form" form might have 4-5 different fields, all named differently, and possibly with different formats (checkboxes, combo box, text box, etc.). Can someone please help? I'm at my wits end.
|
||
|
|
Pro |
Are the forms attached to Contacts?
If so, try putting this in your letter template (putting in your form and field names, of course): <$foreach recordSet contact.customRecordSets$> <$if recordSet.name == "Form Name"$> Field1: <$recordSet.dictionaryRepresentation.Field1 Name$> Field2: <$recordSet.dictionaryRepresentation.Field2 Name$> <$endif$> <$endforeach do$> If the field is checkboxes, the letter will show the value of the checked boxes, separated by commas. Other items will show up with whatever data is in the form. Scott |
|||
|
|
Apprentice |
Thanks for the help, but I must be doing something wrong. I have a form named "Package Request", with two items in the form- "Liquidity?" and "Project Investing In". I'm trying to merge the form data into a letter, so I click on a contact, and try to "Write Letter in Daylite". Although I have edited the letter prior to trying to merge it, it shows nothing. Can you give me the same example you showed me, but plug in my variables? I'm new to Daylite, and for some reason, I'm just not getting it. Additionally- you're using an if statement, and a foreach statement in the form letter itself. I didn't see any instructions on how to do that in the manual! Is there a guide that you know f that can tell me the statements that can be used and their proper format? Because a contact might have the same form (with different information) attached to it, ideally I would like the form letter to ONLY grab the latest form data. Is that possible? First things first, though- hopefully I can get your initial code working first. Thank you so much for your help. Byran |
|||
|
|
Pro |
Okay, using your variables, this is what I'd try:
<$foreach recordSet contact.customRecordSets$> <$if recordSet.name == "Package Request"$> Liquidity? <$recordSet.dictionaryRepresentation.Liquidity?$> Investing in: <$recordSet.dictionaryRepresentation.Project Investing in$> <$endif$> <$endforeach do$> I'm not sure whether the question mark in the field name "Liquidity?" might be causing any problems (just a thought - I have no reason to think it would except that I've found that punctuation can sometimes cause problems with some types of coding). Also, in the form, you'll notice that there are sort of 2 form names -- there's the name you give the form in the preferences when you're originally creating it, and you can assign another name to each individual form when you add it to a Contact. This code gets that individual form name you assign upon adding it to the Contact. The code for getting the form name as it is set in the preference is a little different (I've got it around here somewhere, but will need to do some digging - I'll post back when I find it.) With the above code, if the individual form instance is either not named or named differently, then nothing will be returned by that code. As for figuring this stuff out, you could try the developer's kit available here: http://www.marketcircle.com/community/extendingDaylite.html It took me quite a bit of trial and error, some help from the folks at MC, and the Daylite Data Descriptions document and the ReportTemplatesHOWTO document that are now in the developer's kit. It turns out that at least some of the code that works for the old (pre-3.0) report system also works in the letter merge system - so those documents should be a good start. |
|||
|
|
Pro |
Easier that I thought -- I found the other code snippet...
1. To grab data from a form using the form name as set in the preferences, use this code: <$if recordSet.customRecordSetDefinition.name == "Package Request"$> 2. To grab data from a form using the name of the individual instance of the form, use this code: <$if recordSet.name == "Package Request"$> If you use code snippet #1, then you don't need to individually name the forms as you add them to Contacts. If you use code snippet #2, you must individually name the forms as you add them to Contacts. I think #2 would come in handy if you use multiple instances of the same form for individual Contacts - e.g., if a contact makes more than one package request at different times, and you want to track them separately -- so you might name them "First Request", "Second Request" and so on; then you could have separate letter templates for whether it's a first or second request and pull the data just from that instance of the form. |
|||
|
|
Apprentice |
Thanks, but it doesn't work. To verify, I made a new form with the name "test", and made 2 new combo box fields: "test1" and "test2". The choices in combo box "test1" are "one", "two", and "three". The choices in "test2" are "a", "b", and "c". My reasoning was that because I am so new to Daylite, maybe I did something incorrectly. I made sure that the new form was attached to Contacts.
I can NOT get the form data into a merged letter, either with the new form, or the one entitled "Package Requests". The standard merge fields however, will show up if desired. What am I doing wrong? I am using build 3.1.1. I desperately need this to work! Thank you very mch for your help, Scott- I just don't know what to do. |
|||
|
|
Pro |
Well, a picture (or movie) is worth a thousand words:
http://homepage.mac.com/sinemac/iMovieTheater27.html It's a little small to view on the site, so I'd recommend downloading it and viewing it locally in Quicktime. In the movie, I go through checking the form and field names for a form. Then to the letter template to input the form and field names. I did it with a couple of different things: Approach 1 using the form name as set in the preferences. Approach 2 using a form name assigned when adding the form to a Contact. Under approach 2 I added the name for a second instance of the form. Then on to the Contact, and added two instances of the form - named "1st Instance" and "2nd Instance" (which is what I put in the template). Then did the merged letter - resulting in: - form data based on the form name as set in the preferences -- which returns both the 1st and 2nd instance data with just the one code snippet (because both instances are based on the same form, and the code is "for each") - form data based on the instance name - so, since I included code in the template for each instance, data for both is displayed. One thing I (re)discovered while playing around with this - capitalization and spacing do matter, in every place where you put form or field names. Hope this helps. Scott |
|||
|
|
Apprentice |
Scott-
Wow! Thank you so much for going to all that trouble. Truly. A million thanks is not enough, but again- thank you. Slight problem though- it still doesn't work. I followed your directions to the letter, so at this point, I'm going to uninstall Daylite completely, and reinstall it. I'll keep you updated on the progress. Once again, the redundant thanks. |
|||
|
|
Apprentice |
Uninstalled, then reinstalled Daylite. Works like a charm now! Thanks a million.
|
|||
|
|
Pro |
No trouble, really - I've received a lot of help over the years when trying to figure out things like this myself, so I'm happy to be able to give back.
Glad to hear it's working for you now... I wonder what was up that a reinstall fixed it? |
|||
|
|
Apprentice |
I've no idea, but I forwarded it on to the MarketCircle staff. Boy, that was frustrating!!
|
|||
|
|
Pro |
Ok, so this is just a little bit off the topic, but thanks to the help in this thread, I've done WAY more than I thought would ever be possible with the old-style letter templates. Basically, I've gotten timeblock info and organization info that are linked to the project and merged them into the form. I've even managed to format my times and dates (from the timeblock) just like I want them, however, the only problem is that all of my merged values have this around them: (" ")
Here is an example: Start Date/Time: Event Location: ("Saturday, September 1, 2007")-("7:30 PM") ("West Des Moines Marriott") End Date/Time: ("1250 Jordan Creek Parkway") ("Saturday, September 1, 2007")-("10:30 PM") ("West Des Moines"), (IA) (50266) Any ideas how I can get rid of this? |
|||
|
|
Pro |
--bump--
Anyone? Can anyone from MC comment on this? |
|||
|
|
Pro |
Scott,
I just wanted to send out a GREAT BIG THANK YOU for this thread. It has literally been the key to doing so much more than I EVER thought I could do with letter templates!!! |
|||
|
|
Pro |
Hi George,
Did you ever figure out how to get rid of the ("") from the info put in the template? |
|||
|
| Previous Topic | Next Topic | powered by eve community | Page 1 2 |
| Please Wait. Your request is being processed... |
|

