NetTalk Central

Author Topic: Sending email from browse update form  (Read 4559 times)

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Sending email from browse update form
« on: March 06, 2019, 11:44:24 AM »
     In a C10/NT10 app, I use SendEmail.  See image Tree.png.  The procedure PasswordResetRequest (a memory form) has the URL on Save set to ResultOfSendEmail. 

     I'm trying to duplicate this on the UpdatePhysicianList form, a normal form that updates a browse.  See image Form.png.  The form has a check box control that when set to Yes, will set the email parameters and call the SendEmail procedure.  The code for this is in the ValidateAll embed and part of this can be seen in the image Code.png.  Upon saving the form, the ResultOfSendEmail page is not displayed, even though the URL on Save is set as seen in image Form.png.  This page does display properly when the PasswordResetRequest memory form is used. 

     I thought this might be due to the form always returning to the browse.  So, I want to call ResultOfSendEmail from my code.  How can I do this?  I tried ResultOfSendEmail(p_web) at the end of my code but it did not seem to work.  Perhaps there is a better way to do this?

Thanks,

Jeff King

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Re: Sending email from browse update form
« Reply #1 on: March 06, 2019, 06:00:04 PM »
     A bit more explanation might be in order.  I have a Browse/Form to maintain a physician/staff list in Physicians.tps.  On Inserting a new physician/staff the update form appears as in the image UpdateForm.png.  At the bottom is a check box.  If set to Yes, I want to automatically create a new record in my users.tps file with some of the information from this physician/staff update form.  This part I have working.  Once the new record in users.tps is completed, I want to send an email to the new physician/staff.  This part is not working.  No email is sent and I do not get the ResultOfSendEmail page.
     As noted in my previous post, I have another form called PasswordResetRequest that uses this same SendEmail procedure, and it does create/send an email properly.  So I believe my site specific email settings are correct.

Thanks,

Jeff

jking

  • Sr. Member
  • ****
  • Posts: 419
    • View Profile
    • Email
Re: Sending email from browse update form
« Reply #2 on: March 07, 2019, 07:10:00 AM »
OK, found a small coding error and moved code to Post Insert embed.  The email is now created and sent but the ResultOfSendEmail page still does not display.  I think I'll just create an alert to notify the user the email was created properly.

Jeff