New call-to-action
Results 1 to 7 of 7

Thread: Link Letter DB to Client DB

  1. #1
    Member
    Real Name
    Rudy Pataky
    Join Date
    Apr 2008
    Location
    Toms River, NJ
    Posts
    171

    Default Link Letter DB to Client DB

    Hi folks,
    I've drawn a blank here and hope one of you can enlighten me once again.
    I created a "Letter" table whuch allows the user to create many different letters.

    The Letter table fields are:
    Letter Description (Index)
    Date Letter Created
    Header
    Body
    Footer


    What I'm trying to do is have the user select a letter from the letter table and then have the user bring up another table (client) and tag each client that the user wants to receive the letter.

    Let's say I have an Un-Paid Dues report and 5 clients have not paid their dues for the 1st quarter. The user should be able to tag those 5 users in the client database and print the same letter for each of them (like a mail merge).

    I want the user to select which letter first from the letter menu either from a dropdown and then use the tag function in the client form. Once all clients are tagged, I will have a print button to produce the letters.

    Am I clear as mud?

    Please help

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Link Letter DB to Client DB

    In the interest of good design, add a field to the letter table to give each letter some sort of id. Create a field in your client table to hold an id_to_be _sent. Link the two tables on the id or use the id in a lookup to decide which letter to send.

    Rough outline, anyway.

  3. #3
    Member
    Real Name
    Rudy Pataky
    Join Date
    Apr 2008
    Location
    Toms River, NJ
    Posts
    171

    Default Re: Link Letter DB to Client DB

    I set up separete letters and that works fine however, it's not dynamic. I want the user to develope his own letters on-the-fly, save them to the table and when needed call one up and "select" the residents to send the letter to.

    I really want the letter table to be the primary and the resident table to be the secondary. On the form, is the letter table and an embedded browse to the right of the letter. I have a button to mark residents and when I say print lettr, I wan't to print the "current letter only" for all marked residents, not the entire letter table.

  4. #4
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Link Letter DB to Client DB

    Rudy,

    And yet a different way to do this.......

    You have to first have a way to send the same letter to multiple clients (a filter of some kind).

    Have a way to mark the client records--could just have a logical checkbox field.

    You could then call up on a form with embedded browse the client records that meet the criteria you have set--your example being clients who have unpaid dues for the first quarter and have the checkboxes set to true (checked)...in doing so you could uncheck or show more records that could be checked.....

    Then have your filter you have for sending the letters to send to only clients who have the True value in the checkbox.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  5. #5
    Member
    Real Name
    Rudy Pataky
    Join Date
    Apr 2008
    Location
    Toms River, NJ
    Posts
    171

    Default Re: Link Letter DB to Client DB

    Hey Mike,

    Could I set up a 2nd common letter table ( 1 entry only) and on my main letter table copy the "current record displayed" to the common table. Then proceed to my letter form and tag my residents and print the tagged resident's letters from the common letter table?

    There is no realitionship between the resident table and letter table. I simply want to select a letter, tag the residents and print that letter. I already have a routine to mark records.

    Thanks

  6. #6
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Link Letter DB to Client DB

    Hi Rudy,

    I think you want to do more work than is necessary! :)

    The following I just did and it works I believe as you want. I had to create an email and a checkbox field and then used them on an embedded browse. Use your field names where indicated. I simply took an Action Script to send a generic saved letter and then converted to xbasic and modified it a little. I used a variable for the "to_param" . Your options may be different as well such as I sent the mail as RTF. If neccessary I could put together a small sample of this.


    Code:
     
    'Send a report, label, letter, form or browse layout as an attachment to an e-mail message. You can specify which records to send.
    
    dim shared lst as c
    lst=""
    if tablecount("YOUR TABLE","YOUR CHECKBOX FIELD NAME")>0
     lst=table.external_record_content_get("YOUR TABLE","alltrim(YOUR EMAIL FIELD NAME)","","YOUR CHECKBOX FIELD NAME")
        lst=crlf_to_comma(lst)
      else
        ui_msg_box("Attention!","You have not selected any clients!")
    end if
    query.filter = ""
    query.order = ""
    to_param = a5_eval_expression(lst,local_variables())
    cc_param = a5_eval_expression("",local_variables())
    bcc_param = a5_eval_expression("",local_variables()) 
    subject_param = a5_eval_expression("TEST_MULTI-MAIL",local_variables()) 
    message_param = a5_eval_expression("",local_variables())
    
    :Letter.Send("YOUR SAVED LETTER","RTF",query.filter,query.order,"default",to_param,subject_param,message_param,cc_param,bcc_param)
    LATER:If wanted, I am sure a similar way could be used to choose a letter if you have a "choice list" that you pick letters from by again using a variable to place in the Letter.send().
    Last edited by MikeC; 06-27-2008 at 12:08 PM.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  7. #7
    Member
    Real Name
    Rudy Pataky
    Join Date
    Apr 2008
    Location
    Toms River, NJ
    Posts
    171

    Default Re: Link Letter DB to Client DB

    Mike, Thanks for all your time and effort trying to teach an old dog like me. I kept saying letter howevre when I print, I want to use a Report, not Letter. The user can add a new letter to the letter table via letter_admin_form, then mark the residents from an embedded browse on the same letter_admin_form, then print the selected letter for all the marked resifents using a Report.

    2 tables, a resident table and a letter table. There is no relationship between the two.
    I set up a test db called testletter with the 2 tables however I can't fugure out how to perform the above mentioned procedure.

    If I email you the test table, do you think you can apply the procedure to it and email it back to me?

    I really do not understand the coding above, however, if I analyize your sent procedure, I can apply it to my app.

    Thanks,
    Rudy

Similar Threads

  1. Search for text with active link, server side - client side
    By ulfk in forum Alpha Five Version 9 - Desktop Applications
    Replies: 0
    Last Post: 05-28-2008, 12:42 PM
  2. if a client doesnt exist open client form
    By Lance Gurd in forum Alpha Five Version 7
    Replies: 11
    Last Post: 02-25-2006, 06:28 PM
  3. Multi-column link not writing link fields in child
    By Lawrence Fox in forum Alpha Five Version 7
    Replies: 10
    Last Post: 01-01-2006, 12:58 PM
  4. Internal link in link address not working
    By Howard G. Cornett in forum Web Application Server v6
    Replies: 2
    Last Post: 08-25-2005, 07:57 AM
  5. Say No to a Client?
    By rtbtat in forum Alpha Five Version 5
    Replies: 22
    Last Post: 07-21-2004, 05:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •