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

How can I use the email actionscript to send values of repeating sections?

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

    How can I use the email actionscript to send values of repeating sections?

    I have a form with a repeating section. I have added an actionscript to send an e-mail after the form has been validated. I've tried using {Quantity[1]} and A5INSTANCE but the values in the fields are not being sent. I am sure I'm doing something wrong. Ideally, I'd like to send the Row Number>Field1|Field2|Field3 to the e-mail address I've designated. Any help is appreciated.

    #2
    Re: How can I use the email actionscript to send values of repeating sections?

    Hi Josh,

    The {placeholder[#]} should work, at least it is working for me. I have something like this in the Message Body (HTML) section of the email actionscript which works:

    Code:
    <tr>
        <td>{Part_Number[1]}</td>
        <td align="right">{Quantity[1]}</td>
        <td><font style="text-transform: uppercase;">{Description[1]}</font></td>
        <td align="right">{Unit_Price[1]}</td>
        <td align="right">{Extended_Price[1]}</td></tr>
      <tr>
        <td>{Part_Number[2]}</td>
        <td align="right">{Quantity[2]}</td>
        <td><font style="text-transform: uppercase;">{Description[2]}</font></td>
        <td align="right">{Unit_Price[2]}</td>
        <td align="right">{Extended_Price[2]}</td></tr>
      <tr>
    Stephen
    Alpha Anywhere v12.4.6.5.2 Build 8867-5691 IIS v10.0 on Windows Server 2019 Std in Hyper-V

    Comment


      #3
      Re: How can I use the email actionscript to send values of repeating sections?

      Stephen,

      This was really helpful. Thanks a lot!

      Comment


        #4
        Re: How can I use the email actionscript to send values of repeating sections?

        Originally posted by iRadiate View Post
        Hi Josh,

        The {placeholder[#]} should work, at least it is working for me. I have something like this in the Message Body (HTML) section of the email actionscript which works:

        Code:
        <tr>
            <td>{Part_Number[1]}</td>
            <td align="right">{Quantity[1]}</td>
            <td><font style="text-transform: uppercase;">{Description[1]}</font></td>
            <td align="right">{Unit_Price[1]}</td>
            <td align="right">{Extended_Price[1]}</td></tr>
          <tr>
            <td>{Part_Number[2]}</td>
            <td align="right">{Quantity[2]}</td>
            <td><font style="text-transform: uppercase;">{Description[2]}</font></td>
            <td align="right">{Unit_Price[2]}</td>
            <td align="right">{Extended_Price[2]}</td></tr>
          <tr>
        Stephen
        Does this assume that there only two rows in the repeating section? What if there were 3, 5, or 8? Do I need to still write the place holders for each row? The number of rows can vary, how can I account for this?

        Comment


          #5
          Re: How can I use the email actionscript to send values of repeating sections?

          I don't think you can use the action javascript to accomplish what you need.

          I believe you'd need to create your own function that would loop through the rows in the repeating section and that would construct the email and send. If I remember correctly, I think the only way this worked was if the number of rows was known/fixed.

          Comment


            #6
            Re: How can I use the email actionscript to send values of repeating sections?

            I was afraid of that... I'm not even sure how to begin to write something like this?

            Comment


              #7
              Re: How can I use the email actionscript to send values of repeating sections?

              Wow, this is really old code created a long time ago in a galaxy far, far away. But seriously, I haven't done it this way in years, because it's a fixed number of rows.
              Josh is right, you have to loop through the repeating section rows. Someone on this forum helped me get this done, I don't recall who it was .. I tried to find the post for you but I can't find it.

              I have the code in the Server-Side afterDialogValidate event. To be honest, the code is quite long, and I don't understand it all.
              I could post it if you want to take a look but I would have to change some of the confidential bits and you'd have to sort out your own field names, etc.
              Alpha Anywhere v12.4.6.5.2 Build 8867-5691 IIS v10.0 on Windows Server 2019 Std in Hyper-V

              Comment


                #8
                Re: How can I use the email actionscript to send values of repeating sections?

                Originally posted by iRadiate View Post
                Wow, this is really old code created a long time ago in a galaxy far, far away. But seriously, I haven't done it this way in years, because it's a fixed number of rows.
                Josh is right, you have to loop through the repeating section rows. Someone on this forum helped me get this done, I don't recall who it was .. I tried to find the post for you but I can't find it.

                I have the code in the Server-Side afterDialogValidate event. To be honest, the code is quite long, and I don't understand it all.
                I could post it if you want to take a look but I would have to change some of the confidential bits and you'd have to sort out your own field names, etc.
                If you could post the code that would be nice, then I can try to figure something out, it will give me a starting point.

                Another Idea I had was to create a separate email button that only sends an email when pressed, the button would call an xbasic function that would return the records in the repeating section by going to the server and making a sql select and place them in a concatenated field, once the result is stored in a variable, have it fill a "dummy" field on the form so that when the email is created it can use this dummy field for the values I am wanting. I think that should work?

                Comment


                  #9
                  Re: How can I use the email actionscript to send values of repeating sections?

                  So I created this xbasic function, and it all works exactly as planned until the very last line. I get an error, image is attached, can you tell me where/what I am doing wrong here?

                  Code:
                  function loadDummyField as c (e as p)
                  	Debug(1)
                  
                  	dim cn as sql::Connection
                  	dim args as sql::Arguments
                  	dim sqlSELECT as c
                  	dim rs as sql::ResultSet
                  	dim dummyField as c
                  			'-----------------------------------------------
                  			'Create concatenated days requested
                  			'-----------------------------------------------
                  			flag = cn.open("::Name::FINANCIAL")
                  			args.set("RecID", e.dataSubmitted.PK_TIMEOFF_REQUEST_ID)
                  			sqlSELECT = <<%sql%
                  			SELECT GROUP_CONCAT(concat_ws(' - ',start_date, hours, payroll_type) ORDER BY start_date SEPARATOR "\r\n") as DummyField
                  			FROM timeoff_request_days 
                  			WHERE fk_timeoff_request_id = :RecID
                  			%sql%
                  			flag = cn.Execute(sqlSELECT, args)
                  			rs = cn.ResultSet
                  			dummyField = rs.data(1)
                  			cn.FreeResult()
                  			cn.close()
                  			loadDummyField = "{dialog.object}.setValue('dummyDaysRequested','" +dummyField+ "');"
                  end function
                  Capture.PNG

                  If I replace
                  Code:
                  loadDummyField = "{dialog.object}.setValue('dummyDaysRequested','" +dummyField+ "');"
                  with
                  Code:
                  loadDummyField = "{dialog.object}.setValue('dummyDaysRequested','test');"
                  then it does everything just fine.
                  Last edited by Gustavo1478; 01-11-2017, 01:06 PM.

                  Comment


                    #10
                    Re: How can I use the email actionscript to send values of repeating sections?

                    Here is what I have in my Server-Side afterDialogValidate event (see attachment).

                    Most of it is not used in my case ie) the mandrill settings, etc. (I just haven't cleaned up the code).
                    I have XXXXXX out any values that can't be posted but you can figure out what they are pretty easily.
                    The main portion of what you need is the looping portion between
                    flag = rs.nextRow()
                    while flag

                    and
                    flag = rs.NextRow()
                    end while


                    My application is a Purchase Order form, so the field names used should be fairly obvious as well.

                    Hope it helps.
                    Stephen
                    Attached Files
                    Alpha Anywhere v12.4.6.5.2 Build 8867-5691 IIS v10.0 on Windows Server 2019 Std in Hyper-V

                    Comment


                      #11
                      Re: How can I use the email actionscript to send values of repeating sections?

                      loadDummyField = "{dialog.object}.setValue('dummyDaysRequested'," +dummyField+ ");"
                      should work.
                      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


                        #12
                        Re: How can I use the email actionscript to send values of repeating sections?

                        Originally posted by GGandhi View Post
                        loadDummyField = "{dialog.object}.setValue('dummyDaysRequested'," +dummyField+ ");"
                        should work.
                        Tried that, now I get:

                        Expected ')'

                        The function I created fires without any errors when looking at the debugger, after the function fires the debugger goes to this line of code (see image, which is not part of what i wrote) and thats when I get the unterminated string constant error. Capture.PNG

                        Comment


                          #13
                          Re: How can I use the email actionscript to send values of repeating sections?

                          Ivan, should you wish to follow the same process that I use, I found the link where I was given this code. And the thanks go to Ghandi ... I should have guessed

                          https://www.alphasoftware.com/alphaf...In-HTML-Output
                          Alpha Anywhere v12.4.6.5.2 Build 8867-5691 IIS v10.0 on Windows Server 2019 Std in Hyper-V

                          Comment


                            #14
                            Re: How can I use the email actionscript to send values of repeating sections?

                            Originally posted by iRadiate View Post
                            Ivan, should you wish to follow the same process that I use, I found the link where I was given this code. And the thanks go to Ghandi ... I should have guessed

                            https://www.alphasoftware.com/alphaf...In-HTML-Output
                            If read through the post and if I understood correctly, you can send a report layout as a pdf instead of using html. Ghandi mentioned this is post #5, how is this accomplished?

                            Unfortunately all the screenCast links dont work :(

                            Comment


                              #15
                              Re: How can I use the email actionscript to send values of repeating sections?

                              those screencasts were purged out due to space limitation.
                              create a report and attach as and attachment. to the email.
                              lot easier than sending email format, which can also be done.
                              you want to use actionscript to do the job for you. but it will not take you to the end. you will need to write code that will accomplish
                              either attachment to an email
                              or construct email
                              or if you must use actionscript to do the job for you then take a look at how to pass a function to actionscript.
                              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