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 - Sent To Problem

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

    #16
    Re: Email Report - Sent To Problem

    The thread that selwyn posted teh video is here
    http://www.alphasoftware.com/alphafo...rentrowdatanew

    This was the missing link for me. First of all I did not have any currentrowdatanew because I didnt add the ajax callback first of all then I didnt set the session var when selecting the row. a double whammy. I learned alot today, and finally got it working. I hope it helps you!
    NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

    Comment


      #17
      Re: Email Report - Sent To Problem

      Originally posted by RIckyRel View Post
      Yes, I have done what was in Post 6 and still got an error. Sorry my skills in debug are limited, but it would not recognise e._currentRowDataNew
      if this is read only grid then you need to check that box, on editable grid the information will be available.
      the field for your email_address will be
      e._currentRowDataNew.your_email_address
      if still having problem post back and I will show you in a screencast.
      if you post back please include whether it is read only grid or editable grid ( I understand it is a child grid in a row expander)
      thanks for reading

      gandhi

      version 11 3381 - 4096
      mysql backend
      http://www.alphawebprogramming.blogspot.com
      [email protected]
      Skype:[email protected]
      1 914 924 5171

      Comment


        #18
        Re: Email Report - Sent To Problem

        Ok, in my grid I set a session variable on row select using this row event javascript and subsequent xbasic function:
        Row Event
        var rowNum = {grid.object}._selectedRow;
        {grid.Object}.ajaxCallback('G',rowNum,'setmailto','','_getData=true',{});

        Function
        function setmailto as c (e as p)
        session.mailto = e._currentRowDataNew.email
        end function

        What I realized is if I select a row with a value the value is set and everything is peachy fine but if I then select another row and the value is a null/empty value the session variable is not set to null but instead retains it's previous value set by the last row select that had a value.

        Shouldn't it be set to NULL if the value in the "email" field is empty?
        In response I set the client-side event AfterDetailViewClose to run an xbasic function to set teh session var to null using this:

        var rowNum = {grid.object}._selectedRow;
        {grid.Object}.ajaxCallback('G',rowNum,'killmailto','','_getData=true',{});

        and killmailto function is:

        function killmailto as c (e as p)
        session.mailto = ""
        end function

        The idea is I do not want to carry over this value into the next row and send an email to the previous customer. I am starting to think a session var is overkill and maybe I should just set the value. The session variable is important to me because I am calling it in the mandrill email function.


        One last thing bugging me is that, when my mandrill function runs (via a button click) the pResult doesn't fire on success or failure even if the email event is successful. This only occurs when I include the session var in the mailto code. Not sure how that would affect the result or when the code is stopping because quite frankly the code is running successfully as I get the email with the attachment...
        ...Perplexed on that one!
        NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

        Comment


          #19
          Re: Email Report - Sent To Problem

          Hello GGandhi,

          Thank you for your reply, I have been able to get my emails working, I just needed a little nudge. The video that Charles supplied was the missing element.

          Thanks again to all that responded. It’s great to have people willing to help, as it enables you to get that extra level of functionality out development.

          Cheers

          Comment


            #20
            Re: Email Report - Sent To Problem

            Ricky be sure to take heed to Selwyn warning about setting the variable and keeping track of it. Good luck!
            NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

            Comment


              #21
              Re: Email Report - Sent To Problem

              Originally posted by RIckyRel View Post
              Hello GGandhi,

              Thank you for your reply, I have been able to get my emails working, I just needed a little nudge. The video that Charles supplied was the missing element.

              Thanks again to all that responded. It’s great to have people willing to help, as it enables you to get that extra level of functionality out development.

              Cheers
              good you got it working, but why session variable etc., to send email. it is just a simple xbasic routine. if you are happy with what you have, that is all it counts. good luck.
              thanks for reading

              gandhi

              version 11 3381 - 4096
              mysql backend
              http://www.alphawebprogramming.blogspot.com
              [email protected]
              Skype:[email protected]
              1 914 924 5171

              Comment


                #22
                Re: Email Report - Sent To Problem

                gandhi,
                in the following xbasic function I want to set the value of ms.send_to to whatever the current value is in the detail view of the grid, even if I change it and or edit it in the detail view. In other words whatever the value is in the "email" field I want to set that as the value of ms.send_to in this email function.

                function ReportForEmail as c (e as p)
                dim key as c
                key = e.fileSessionKey
                dim b as b
                'get the binary day for the report
                session.GetDataFromFile(b,key)
                dim size as n
                size = b.size()
                if size = 0 then
                customMandrill = "alert('Report was not sent.');"
                exit function
                end if
                'If you don't have a Mandrill secret key, sign up at Mandrill.com
                dim mysecretkey as c = "" 'if you leave this blank the key value is read from a setting in Project Properties
                dim ms as p
                ms.send_to = mailto
                if mailto = "" then
                customMandrill = "alert('Email Address is blank!');"
                exit function
                end if
                ms.from_email = "[email protected]"
                ms.subject = "Wildlife Control Invoice/Estimate"
                ms.message_html = "Please find the attched invoice and or estimate"

                dim ms.attachmentsArray[1] as p
                ms.attachmentsArray[1].name = "Wildlife Control.pdf" 'if the report was an html report, use the .html extension
                ms.attachmentsArray[1].type = resolve_mime_type("pdf") 'if the report was an html report, use the 'html'
                ms.attachmentsArray[1].content = base64encode(b)
                dim pResult as p
                pResult = email_send_mandrill(mysecretkey,ms)
                if pResult.error = .f. then
                customMandrill = "alert('Report sent.');"
                else
                __name = "alert('Report was not sent.');"
                end if
                end function


                Currently I am using a session variable that is set by the ajax callback calling a function.

                Is there a better mor eefficient way.
                For both ricky and I we did not have the ajax callback setup to get the currentdata so our currentRowDataNew values in the debugger were null, and we didnt know why. Hope I am not beating this to death, btw but I love learning Alpha and you have been such a big help in the past!
                Last edited by CharlesParker; 08-12-2015, 11:51 PM.
                NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                Comment


                  #23
                  Re: Email Report - Sent To Problem

                  Oh by the way,
                  I just dimmed a var in a func for my ajax callback as such

                  function setmailto as c (e as p)
                  dim mailto as c
                  var mailto = e._currentRowDataNew.email
                  if var mailto = "" then
                  mailto = "No Send to email present"
                  end if
                  end function
                  NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                  Comment


                    #24
                    Re: Email Report - Sent To Problem

                    take a look at these screencasts:
                    http://screencast.com/t/eyKBzoXt4Y

                    http://screencast.com/t/kfCZTl30J

                    firstly I am not sending this via mandrill, but the videos are to show you the data being harvested from the grid. secondly I am building a report and attaching that report as pdf without building an array. if that is a requirement in mandrill, then that is the way to go. I do have a mandrill account, later this week I will test sending mail via mandrill to see how that goes. i am sure i will ask your help in mandrill way of email.
                    in the meantime good luck.

                    update: I just sent an email via mandrill ( no email_send_mandrill() function involved, it is not available in version 11 as far as I can tell, may be it is) and it works just fine as I expected. and I will send an attachment as I do normally and let you know. cannot be that difficult.
                    Last edited by GGandhi; 08-13-2015, 07:18 AM.
                    thanks for reading

                    gandhi

                    version 11 3381 - 4096
                    mysql backend
                    http://www.alphawebprogramming.blogspot.com
                    [email protected]
                    Skype:[email protected]
                    1 914 924 5171

                    Comment

                    Working...
                    X