Alpha Video Training
Results 1 to 4 of 4

Thread: emailing a transaction list/history

  1. #1
    Member Chris.Tanti's Avatar
    Real Name
    Chris Tanti
    Join Date
    May 2000
    Location
    Cardiff, South Wales, UK
    Posts
    368

    Default emailing a transaction list/history

    I am just getting to grips with A5's internal email functions, and getting some realy useful resuls (one of the best bew features)

    I have a typical one to many db set up, what I would like to do is put the transactions associated with the current parent record in an e-mail.

    I know I can e-mail the contents of a memo field.
    Is it possible to build a routine that goes through the current records associated transactions, and append them to a memo field on the parent record so I can send them in an e-mail?

    I have a couple of ideas, but is there an elegant way of doing this?

    Many thanks

  2. #2
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,279

    Default RE: emailing a transaction list/history

    this feature is now built into a5v5.

    see the release notes for the patches.

    when you create the email message, click the "insert command" button, then select the One to Many command (command will only be there if your form is based on a set with one-many links.

    the command will insert this into your email (this example is for alphasport's invoice set)

    put any fields you want from the transaction table into the region between the start and the end of the one-many command.

    [.ONE_MANY:Invoice_Items]

    Replace this text with field from the table.

    [.END_ONE_MANY]

  3. #3
    Member Chris.Tanti's Avatar
    Real Name
    Chris Tanti
    Join Date
    May 2000
    Location
    Cardiff, South Wales, UK
    Posts
    368

    Default RE: emailing a transaction list/history

    That sounds much simpler than what I came up with over the weekend!

    I wanted to hard code the email into a button and not use A5's internal mail, is that possible with your method.

    My example is below.

    **********

    topparent.commit()

    tbl=table.current()
    tbl.change_begin()
    tbl.email_note = ""
    tbl.change_end(.t.)

    count=0
    xprevline=""
    child_tbl=table.get("tbl_mail_trans")
    child_tbl.fetch_first()
    WHILE .not. child_tbl.fetch_eof()
    count=count+1
    xline="("+str(count)+") "+dtoc(tbl_mail_trans->date_mailed)+" Units:"+ \
    str(tbl_mail_trans->units_mailed)+" "+trim(tbl_mail_trans->posting_type)+ \
    " "+trim(tbl_mail_trans->outer_used)
    xprevline=xprevline+chr(13)+chr(10)+xline
    child_tbl.fetch_next()
    END WHILE

    tbl=table.current()
    tbl.change_begin()
    tbl.email_note = xprevline
    tbl.change_end(.t.)


    var->xclientfullname=ltrim(trim(people->title)+" "+trim(people->first_name)+" "+trim(people->last_name)+" "+trim(people->suffix))

    dim e as p
    e = email.open()
    e.client_hostname="192.168.*.*"
    e.mail_hostname="192.168.*.*"
    e.client_identity="job.admin@***.net"
    e.send_cc=tbl_job->job_econtact
    e.client_username="job.admin"
    e.client_password="****"
    e.send_to=people->email
    e.send_subject="R&M Posting Alert For Job "+ltrim(str(tbl_job->job_number))
    e.send_contents="Ref Job: "+ltrim(str(tbl_job->job_number))+chr(10)+"This is am alert to inform you that *** has mailed the following items"+chr(10)+chr(10)+tbl_mail_header->email_note
    e.send()
    if e.errors "" then
    ui_msg_box("Error",e.errors)
    end if
    delete e

    xstatus=" Post info emailed"
    topparent.resynch()

  4. #4
    Alpha Software Employee Selwyn Rabins's Avatar
    Real Name
    Selwyn Rabins
    Join Date
    Mar 2000
    Location
    Boston, MA
    Posts
    5,279

    Default RE: emailing a transaction list/history

    you can do it your way but it is hard.

    the easiest way is to

    1. define your template.
    2. use the action script genie to "send an e-mail message"
    3. choose the a5 internal client.
    4. the a5 internal client gives you the option of just sending the email WITHOUT opening the client.


    no need to do any programming here at all.

Similar Threads

  1. How to clear history from menu
    By Barron Weant in forum Alpha Five Version 4
    Replies: 3
    Last Post: 07-10-2003, 02:00 PM
  2. history in find by key
    By Trixie dela Cena in forum Alpha Five Version 5
    Replies: 2
    Last Post: 03-25-2003, 06:11 AM
  3. Changing history
    By Ian Copestake in forum Alpha Five Version 4
    Replies: 10
    Last Post: 10-28-2001, 02:02 PM
  4. History report
    By Samuel Eskenasy in forum Alpha Five Version 4
    Replies: 1
    Last Post: 08-23-2001, 06:48 AM
  5. Keeping Invoice History
    By Bob Elliott in forum Alpha Five Version 4
    Replies: 12
    Last Post: 03-08-2001, 11:45 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
  •