I'm trying to troubleshoot a "problem compiling script.

Josh Beall (Customer) asked a question.

Hi All, I'm trying to troubleshoot a "problem compiling script. . .

Hi All,

I'm trying to troubleshoot a "problem compiling script" error that I'm getting, and I'm rather perplexed as to the source. The stacktrace I've got looks like this:

There was a problem compiling the script. Please refer to the Exception Log.

StackTrace Information

*********************************************

at Aptify.Framework.Scripting.ScriptEngine.CompileExecutable()

at Aptify.Framework.BusinessLogic.ProcessPipeline.AptifyEventFire.ExecuteScript(String EventDefinitionName, AptifyGenericEntityBase GE, String ScriptToExecute)

That looks to me like there's an event handler that's firing a process flow that has a bad script in it. Right?

But here's the thing: I've disabled every single one of the event handlers as I tried to figure out which event handler was triggering this!

You can see this behavior here in this video:

https://goo.gl/6LUipd

What else might be triggering this error, besides an active event handler?

-Josh

0

Comments

10 comments
  • Josh Carlson (PerByte)
     
    Josh, you'll want to look at your Event Definitions as well. Regardless of an event firing they are compiled and processed so be on the lookout for any that have a script attached. Best of luck!
    0
  • Robert Kihm (Customer)
     
    Josh Carlson's suggestion is a good one. Based on the Stack Trace mentioning AptifyEventFire.ExecuteScript, it is a script tied to an Event Definition.
    0
  • Josh Carlson (PerByte)

    Robert Kihm, while you're here... what about hooking up a precompiled assembly to be the event definition instead of having to use the script? I know the intent is to keep those slim but there are advantages in some projects of being able to manage those with the rest of the code.

    0
  • Robert Kihm (Customer)

    Adding support for a .NET plug-in is possible. Submit it as a Feature Request. Creating a post in the Group to get people talking about the value of having a Filter Trigger that is .NET code vs Script would be interesting. As you mention, Filter Triggers need to be light weight because they are executed to determine whether or not an Event should fire. My concern would be that having it in a .NET assembly may encourage people to build more expensive Filter Triggers and the cost may be less apparent because the code is less visible.

    0
  • Josh Carlson (PerByte)
     
    I thought you were going all in with telemetry ;-). Measure it and then send a nastygram through Spaces for anyone with a developer license (similar to Outlook when you have slow loading COM add-ins).
    0
  • Josh Beall (Customer)
     
    Interesting. I'll look at that. Just to make sure I understand, you're saying that AptifyEventFire.ExecuteScript may get called even if it's not actually executing the event (and thus, executing the script)?
    0
  • Josh Carlson (PerByte)
     
    Josh Beall, yes. Near as I can figure it is processing all of the event definitions associated with a specific "base event" (i.e. AfterSave) to determine which events need to fire, even if nothing is hooked up to them. Your Event Handlers on the other hand won't compile/process unless they are active and would fire anyway.
    0
  • Josh Beall (Customer)
     
    Is there any way to get Aptify to tell me which event definition, or process flow, is actually the culprit? You can see from the stack trace that there is an argument EventDefinitionName... would be great if the value of that param was included in this stack trace!
    0
  • Robert Kihm (Customer)
     

    If there's no other exception logged along with that one, I don't think that information is captured. In the next release, we have added more information to the exception logged by ExecuteScript to include things like the EventDefinitionName, Entity, RecordID and Script.

    0
  • Robert Kihm (Customer)
     
    I like it!
    0

Please sign in to leave a comment.

Didn't find what you were looking for?

New post