Scripting

  • 1.  Hello all - File this one under 'Entry Level Scr

    Posted 11-03-2015 08:06
      |   view attached
    Hello all - File this one under 'Entry Level Scripting' I have a simple Sales Order Header script that updates a udf field. It runs as expected in my test environment. When deployed at the customer site, it runs fine if I login as an admin user. Once I login as a non-admin user, I get the following error: Error 88: Invalid/unknown property name o/s error Type mismatch:'oSession.AsObject'(err/ret=2/0) (see attached image) if I give the user full access (ie admin) rights, the script runs as expected. ~sigh~ I know its something simple i'm missing, but I cant seem to figure it out. Any ideas? Thank you! Marc


  • 2.  RE: Hello all - File this one under 'Entry Level Scr

    Posted 11-03-2015 08:36
    Check out this thread https://90minds-com.socialcast.com/messages/27070024 and see @MichaelNottoli comment as that fixed my issue


  • 3.  RE: Hello all - File this one under 'Entry Level Scr

    Posted 11-03-2015 09:02
    If you post your script, I'm happy to take a look


  • 4.  RE: Hello all - File this one under 'Entry Level Scr

    Posted 11-03-2015 09:16
    If this is Sage 100 or Premium, set to run the script on the client. Do the results change?


  • 5.  RE: Hello all - File this one under 'Entry Level Scr

    Posted 11-03-2015 12:09
    Hey @MarcCregan if this is Sage 100 Advanced and customer has Avalara then there are some Avalara files that need to be copied to the local workstation mas90 folder. I can't find my notes on this. Let me know if both of these conditions are true and i'll keep looking.


  • 6.  RE: Hello all - File this one under 'Entry Level Scr

    Posted 11-04-2015 06:53
    Hi all - Thank you all for your input - i appreciate all the help ALOT! This is a Sage 100 Standard install @MyronStevenson - no avatax at this site @DougJenkins @PhilMcIntosh I changed up my script per your suggestion/post and @MichaelNottoli suggestion in your post by removing the oSession.AsObject(oSession.GetObject and replacing it with the syntax oBusObj.AsObject(oBusObj.GetChildHandle Tested it and it worked the same as before on the sample data (as expected). Deployed at the customer site and no errors! So far so good - we'll see how it goes today. i'll post back a confirmation once we've got a day or two without issue. So I ~think~ we have it figured out guys! Iis there any reason not to just use the oBusObj.AsObject(oBusObj.GetChildHandle syntax everytime instead of the osession object?


  • 7.  RE: Hello all - File this one under 'Entry Level Scr

    Posted 11-04-2015 07:01
    I think what happens is GetChildHandle doesn't check permissions on the subsidiary object whereas GetObject does, but that is just a guess based on behavior...


  • 8.  RE: Hello all - File this one under 'Entry Level Scr

    Posted 11-04-2015 08:34
    From Steve Malmgren: The GetChildHandle method will return an object handle to this service object. The advantage to this is that it is already in memory. In general you should only use a _bus object if you want to add, update or delete a row. If you only need to validate or read a row, use the service object. If the business object already validates a column against a table use the .GetChildHandle() to use the service object already in memory.


  • 9.  RE: Hello all - File this one under 'Entry Level Scr

    Posted 11-05-2015 14:22
    Hi guys - so far so good. Appears this solved the issue. Thanks again!