Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Email Report

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Email Report

    When I run the code below in the Code Editor it works fine but not from a button on a UX!

    'Create a new variable called 'ccodem' and set its value to '=customer_id
    dim Global ccodem AS C
    ccodem = e.dataSubmitted.customer_id
    'Print a report, label, letter, form or browse layout. You can specify which records to print.

    query.filter = "customer_id = Var->ccodem"
    query.order = "recno()"
    'replace variables in the filter with their actual values
    query.filter = convert_expression(query.filter,"VE")
    :Report.SaveAs("statementem","PDF",query.filter,query.order,"C:\alphatemp\stmt.pdf",.F.)
    Dim message_type as c
    message_type = ""
    _to_var = a5_eval_expression("=\"[email protected]\"",local_variables())
    param_to = _to_var
    param_subject = "\"Statement of Account\""
    param_cc = ""
    param_bcc = ""
    message_var = a5_eval_expression("=\"Please find your Statement of Account attached\"",local_variables())
    param_message = message_var
    attachment_list = <<%a%
    C:\alphatemp\stmt.pdf
    %a%
    param_attachments = alltrim(attachment_list)
    'Send the e-mail using the external e-mail client
    email_client_external(param_to,param_subject,param_message,param_attachments,param_cc,param_bcc)

    When run from the UX I get
    emailproblem.png

    Any suggestions?

  • #2
    Re: Email Report

    sounds like this should be in the web forum
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    [email protected]

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

    Comment


    • #3
      Re: Email Report

      Originally posted by martinwcole View Post
      sounds like this should be in the web forum
      This is in a desktop system.

      Comment


      • #4
        Re: Email Report

        Did you run it with "debug(1)" at the beginning to see that all your variables are what they are supposed to be? Debugging allows you to follow each step of the code. I would be LOST without it.

        Comment


        • #5
          Re: Email Report

          what is "e" in [ccodem = e.dataSubmitted.customer_id]
          this script in very complicated - it could be reduced to about 10% of what it is now
          Cole Custom Programming - Terrell, Texas
          972 524 8714
          [email protected]

          ____________________
          "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

          Comment


          • #6
            Re: Email Report

            on the form where this is to be run from, put a button, and put this code in the onpush event - let me know if it works

            parentform.comit()
            dim Global ccodem AS C
            ccodem=parentform:customer_id.value
            query.filter = "customer_id = Var->ccodem" 'be sure the object name is customer_id on the form
            query.order = "recno()"
            :Report.SaveAs("statementem","PDF",query.filter,query.order,"C:\alphatemp\stmt.pdf",.F.)
            param_to = "[email protected]"
            param_subject = "Statement of Account"
            param_cc = ""
            param_bcc = ""
            param_message = "Please find your Statement of Account attached"
            param_attachments = "C:\alphatemp\stmt.pdf"
            'Send the e-mail using the external e-mail client
            email_client_external(param_to,param_subject,param_message,param_attachments,param_cc,param_bcc)
            Cole Custom Programming - Terrell, Texas
            972 524 8714
            [email protected]

            ____________________
            "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

            Comment


            • #7
              Re: Email Report

              Martin,

              Thanks for this code. (Note the misspelling of "parentform.commit")

              I works intermittently. But now I'm getting the error message, "MAPI_E_Failure" pretty consistently. Any ideas? I'm using windows Live Mail on a Windows 7 machine.

              TIA ~ Tom

              Comment


              • #8
                Re: Email Report

                It sounds like the error is not Alpha - find out from your ISP if you have pop3, and if you do, enter the settings and use Alpha's builtin email
                Otherwise, you could use Mandrill - which bypasses everybody. I use Mandrill for all my mass mailings, and Alpha builtin for the rest.

                PS: change :Report.SaveAs("statementem","PDF",query.filter,query.order,"C:\alphatemp\stmt.pdf",.F.) to
                :Report.SaveAs("statementem","PDF",query.filter,query.order,"C:\alphatemp\stmt",.F.)
                Cole Custom Programming - Terrell, Texas
                972 524 8714
                [email protected]

                ____________________
                "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                Comment


                • #9
                  Re: Email Report

                  Martin,

                  Thanks for the prompt response. I need this for my app, so it needs to be generic.
                  I've tried the email_send2() option without success.

                  Can you use Mandrill for individual emails? I just looked at there website and see the first 12,000 are free!

                  ~ Tom

                  Comment


                  • #10
                    Re: Email Report

                    What do you mean by "generic"
                    Yes, you can use Mandrill for one email
                    did you check with your ISP to find out if you have Pop 3 settings
                    Cole Custom Programming - Terrell, Texas
                    972 524 8714
                    [email protected]

                    ____________________
                    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                    Comment


                    • #11
                      Re: Email Report

                      My incoming mail is set to POP3: pop.chartermi.net and my outgoing is: smtp.chartermi.net

                      By generic, I mean any user of my application could send emails.

                      ~ Tom

                      Comment


                      • #12
                        Re: Email Report

                        do you have logmein or similar so you could send me a link to your computer?
                        Cole Custom Programming - Terrell, Texas
                        972 524 8714
                        [email protected]

                        ____________________
                        "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                        Comment


                        • #13
                          Re: Email Report

                          It might help to keep in mind which of Alpha's send external you use
                          I read in the help notes a couple of weeks back that MAPI is used in one or two of them.

                          MAPI is Microsoft written API and may be external email client specific and certain versions of Outlook, depending in which MAPI version used by the particular Alpha version. It's not entirely predictable and seems to affect attachments mainly.

                          It certainly doesn't like attachments in Thunderbird on WIN 8 with v12, for one example I have come across.
                          So I've stopped using the external send mail methods..
                          Last edited by Ray in Capetown; 06-18-2015, 05:07 PM.

                          Comment


                          • #14
                            Re: Email Report

                            Thanks Ray. Martin Cole did a gotoMeeting with me and got me pointed in the right direction. I had not setup email in my settings amongst other problems. ~ Tom

                            Comment


                            • #15
                              Re: Email Report

                              Yeh Martin's very generous that way.

                              Comment

                              Working...
                              X