How to invoke script debugger in inbound action script?

Vishal Pallikon
Tera Contributor

I have an inbound action script that is supposed to create a record. I can see the email received in the instance but the record is not being created. In the email logs it says "record not created or updated using current". To investigate this I have added a few gs.info(); statements and I was able to trace the point where the code is terminating which is halfway through the code. I was also able to create a record using current.insert(); at the point where the last gs.info(); statement was getting logged. But I want to know what exactly is causing the code to terminate and not execute further after that point.

 

Tried the script debugger but I'm unable to trigger the Script debugger to fire after setting a breakpoint either by sending a new email or by reprocessing the email. It still says "Status: WAITING_FOR_FIRST_BREAKPOINT".

 

Help is greatly appreciated if someone figures a way to trigger the script debugger in the inbound actions script. TIA.

1 ACCEPTED SOLUTION

Hi @Vishal Pallikon ,

 

With script debugger, that's right you can't do it. How I do for inbound is I dry run the code with the information that comes in and try to analyze how system would interpret it. And ofcourse gs.log() the traditional way. If code is short then I copy it to the background script glide record the email and replace all the "current" with gr and try my code which will not help in your case as you mentioned it's a 300 lines of code. So log() is the only way you are left with.

 

One Gloden Rule to figure it out IF debugger will invoke or not. Just put one line at the start of your code :

 

 

 

gs.log( "Debugger will invoke - "+ gs.isInteractive() ) 

 

 

 

If gs.isInteractive() returns true then it will invoke the debugger else NOT.

 

I hope this help.

 

Please mark this helpful if this helps and Accept the solution if this solves your issue.

 

Regards,

Kamlesh

View solution in original post

6 REPLIES 6

So in conclusion there is no way I will be able to debug my inbound action script right?

Hi @Vishal Pallikon ,

 

With script debugger, that's right you can't do it. How I do for inbound is I dry run the code with the information that comes in and try to analyze how system would interpret it. And ofcourse gs.log() the traditional way. If code is short then I copy it to the background script glide record the email and replace all the "current" with gr and try my code which will not help in your case as you mentioned it's a 300 lines of code. So log() is the only way you are left with.

 

One Gloden Rule to figure it out IF debugger will invoke or not. Just put one line at the start of your code :

 

 

 

gs.log( "Debugger will invoke - "+ gs.isInteractive() ) 

 

 

 

If gs.isInteractive() returns true then it will invoke the debugger else NOT.

 

I hope this help.

 

Please mark this helpful if this helps and Accept the solution if this solves your issue.

 

Regards,

Kamlesh