Scripting

  • 1.  I am trying to create a script to activate on pre-

    Posted 10-19-2011 05:51
    I am trying to create a script to activate on pre-writes of the sales order detail in 4.40 PU5. Randomly, it will cause a crash on the server (this is MAS 200). But, if we do not have a job number (from job cost), then it works flawlessly every time. I have tried turning cost costs off and on as required fields and that has no bearing. There's just something with the integration to job cost that causes the scripting to crash and I can't seem to figure this out.


  • 2.  RE: I am trying to create a script to activate on pre-

    Posted 10-19-2011 05:52
    Oh, and I've also tried pre-writes on the sales order header, where it accesses the lines (loops through) and it will still randomly crash. By random I really mean random. Sometimes after a couple lines, sometimes we can go 30 lines then it will crash.


  • 3.  RE: I am trying to create a script to activate on pre-

    Posted 10-19-2011 05:53
    The error on the server is pvxio.dll which seems to be a memory leak of some kind.


  • 4.  RE: I am trying to create a script to activate on pre-

    Posted 10-19-2011 07:45
    It seems like the event driven scripts are just FUBAR if you're trying to do anything too complex. Simple things work just fine. I'm going back to the button scripts until version 4.50 in which Sage has indicated they've fixed the interpreter.


  • 5.  RE: I am trying to create a script to activate on pre-

    Posted 10-20-2011 05:47
    We were looking at the source code that runs when you process scripts and it was amazing at how poorly written the code was. There were a few places where they broke their own rules for the standard programming methods. You can spot them in the code because next to it is the managers initals saying it was OK to break the rules. Got to love it.


  • 6.  RE: I am trying to create a script to activate on pre-

    Posted 10-20-2011 06:33
    Which source code were you looking at -- version 4.40 or version 4.50?


  • 7.  RE: I am trying to create a script to activate on pre-

    Posted 10-20-2011 07:31
    Version 4.4


  • 8.  RE: I am trying to create a script to activate on pre-

    Posted 10-20-2011 11:59
    Doubtful if it was cleaned up in v4.5. Does there appear to be any commonality in breaking the rules? Are they trying to be ""innovative"" and just can't get er done? Or is it the price (or lack there of) of what you pay when you have inexperienced coders? Are you part of a Master Developer group? Jim W, what does your team think of the source code?


  • 9.  RE: I am trying to create a script to activate on pre-

    Posted 10-20-2011 12:49
    Yes @JeffSchwenk we are part of a Developer group. We have access to the forums. The main thing we saw was gotos and other methods that broke out of the object or jumped around in the object. Some cases it might be needed for efficiency and what not but it didn't appear to be very clean how they did it compared to other code we see. The source code was specifically with breaking out to run script. Other source code is usually not as bad.


  • 10.  RE: I am trying to create a script to activate on pre-

    Posted 10-20-2011 13:17
    I wonder if this ""breaking out of the object"" business causes memory leaks. Because I was trying to help a customer with a very complex script -- it creates new items from variables on S/O lines and attaches vendors to those items -- and randomly we saw it crash on the server with a pvxio.dll error. That seems to be a memory leak to me.