211
Views
6
Comments
Solved
Cannot debug the preparation of an email template

I have an email template that I want to observe the steps of the preparation so I can understand what is wrong with it. I can set breakpoints in the email template's preparation, but the debugger will not stop on them. 

The email template is being sent from a screen action in a web block. I need to debug what happens in the preparation of the actual email template being sent. 

I haven't seen where this is not possible in all my reading today on sending emails, but it is never addressed specifically. Is there something different that I need to do aside of launching the debugger?

Thanks for your help!

2020-02-28 09-46-54
Eduardo Jauch
Solution

Hello Jason, 

I never had a probl to debug email preparations before. 

But they have a characteristic that is similar to the timers. They are executed in their own session and launched by a service in the server, not your app. 

This means that you can't debug in your personal area (F6). You need to have your Service Studio debugging in the public area. 

Not that this is the problem, but if you are debugging your application on personal are, try to do it in the public area. 

Another possibility is that the service is not even reaching the email preparation. 

Did you check in Service Center monitoring tab to see if it is trying to send the mail? And eventually what is the error? 

Cheers. 

2019-06-25 18-22-56
Jason Pirok

Thanks for that pointer. All of my code was functioning, emails being sent, preparations running, etc but the fact I couldn't hit a breakpoint was disturbing. I did not have problems with the code. I only needed to see the data coming back from one of the calls. 

UserImage.jpg
G Andrew Duthie
 
MVP

Jason Pirok wrote:

Thanks for that pointer. All of my code was functioning, emails being sent, preparations running, etc but the fact I couldn't hit a breakpoint was disturbing. I did not have problems with the code. I only needed to see the data coming back from one of the calls. 

In that kind of situation, I'll sometimes set up a test harness to call the action/function that returns the data, so I can view it more easily. Debugging via breakpoints is only one tool in the developer's toolbox. :-)


UserImage.jpg
G Andrew Duthie
 
MVP

Questions:

  • What version of the OutSystems platform are you using?
  • What version of Service Studio?
  • Are you able to hit breakpoints elsewhere in your app?
  • Have you tried extracting the portion of your preparation to a separate Server Action to see if you can successfully debug it there?
  • Can you share a small OML that reproduces the issue?
2019-06-25 18-22-56
Jason Pirok

In Order:

  • Outsystems 11
  • 11.5.43 Build 1969
  • Yes, I have hit breakpoints in this same module.
  • That is work that I shouldn't have to do.
  • I will try to get you an OML in the morning.
UserImage.jpg
G Andrew Duthie
 
MVP

"That is work that I shouldn't have to do."

Perhaps I wasn't clear what I meant regarding extracting logic to a separate Server Action.

When something doesn't work, whether it's code, electronics, mechanical, I follow some basic troubleshooting questions or procedures:

  • Did it ever work?
  • If it did, what (if anything) changed since it worked?
  • Is there a way I can isolate the parts to see which part isn't working (for example, try a light bulb in a different fixture, or a fixture with a new light bulb).
  • etc.

What I asked regarding moving the logic to a separate Server Action falls under the third category. Not saying you should necessarily always have a separate Server Action (though that can make sense sometimes), but rather that if the logic in the preparation works and can be debugged in a Server Action, that may give you useful information in troubleshooting.


2020-02-28 09-46-54
Eduardo Jauch
Solution

Hello Jason, 

I never had a probl to debug email preparations before. 

But they have a characteristic that is similar to the timers. They are executed in their own session and launched by a service in the server, not your app. 

This means that you can't debug in your personal area (F6). You need to have your Service Studio debugging in the public area. 

Not that this is the problem, but if you are debugging your application on personal are, try to do it in the public area. 

Another possibility is that the service is not even reaching the email preparation. 

Did you check in Service Center monitoring tab to see if it is trying to send the mail? And eventually what is the error? 

Cheers. 

2019-06-25 18-22-56
Jason Pirok

Thanks for that pointer. All of my code was functioning, emails being sent, preparations running, etc but the fact I couldn't hit a breakpoint was disturbing. I did not have problems with the code. I only needed to see the data coming back from one of the calls. 

UserImage.jpg
G Andrew Duthie
 
MVP

Jason Pirok wrote:

Thanks for that pointer. All of my code was functioning, emails being sent, preparations running, etc but the fact I couldn't hit a breakpoint was disturbing. I did not have problems with the code. I only needed to see the data coming back from one of the calls. 

In that kind of situation, I'll sometimes set up a test harness to call the action/function that returns the data, so I can view it more easily. Debugging via breakpoints is only one tool in the developer's toolbox. :-)


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.