Scripting

  • 1.  Is there a way to programmatically determine the b

    Posted 05-23-2017 15:27
    Is there a way to programmatically determine the business object for a given Sage 100 table. For example, given the table ""CI_Item"" how could I determine the business object ""CI_ItemCode_Bus""?


  • 2.  RE: Is there a way to programmatically determine the b

    Posted 05-23-2017 17:44
    if you are running on a table UDS, you can use sClassName = """" : sClassName = oScript.Evaluate(""_obj'_class$"") if you are running on a UI UDS, you can use sClassName = """" : sClassName = oScript.Evaluate(""coBusiness'_class$"")


  • 3.  RE: Is there a way to programmatically determine the b

    Posted 05-23-2017 19:30
    @DavidSpeckII Thank you for your response! I should have been more clear in that the perspective is from an external BOI script that starts with only the table name. I want to modify fields and need to be able to address its business object (_BUS).


  • 4.  RE: Is there a way to programmatically determine the b

    Posted 05-23-2017 20:13
      |   view attached
    I don't think I have a good answer for you then. One approach you could take would be to write a parser for the providex.ddf file or depending on how many lines it will take to get what you need, you might just be able to do it in a couple Execute or Evaluate lines. Since you said it is an external BOI script, you would use it like this. In this example, I'm calling a providex program to run. In your case, you would probably want to use Evaluate and have the providex program return the business object name. Dim oShell : Set oShell = CreateObject(""WScript.Shell"") Dim sPath : sPath = """" : sPath = oShell.RegRead(""HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\SOTAMAS90\Directory"") Set oPVXSession = CreateObject (""ProvideX.Script"") oPVXSession.Init(sPath & ""\Home"") oPVXSession.Execute(""CALL """"..\CM\Script\Manage_ESS_Combine_Invoices_Mod.pl"""""") Set oScript = Nothing Set oShell = Nothing Set oPVXSession = Nothing Perhaps someone else might know a better way to get what you need though.


  • 5.  RE: Is there a way to programmatically determine the b

    Posted 05-23-2017 22:00
    Turns out it wasn't as involved as i thought it might be. I have attached 3 files. The ""v2"" handles everything in one vbscript file. The ""v1"" files use one vbscript file to run the one providex file. The providex file is able to account for when the record is not found by using ""DOM=*END"", this results in ""sBusinessObjectName"" being blank. Whereas in the ""v2"" file, it was necessary to use ""on error resume next"" and you can decide how in depth you want to account for errors but it will also result in ""sBusinessObjectName"" being blank if the value stored in ""sTableName"" is not found.

    Attachment(s)



  • 6.  RE: Is there a way to programmatically determine the b

    Posted 05-24-2017 06:59
    **WOW** David!!!! Keep this up and we will be **PAYING** Troy to keep you in the group. Make sure you have MOTM 2018 on your calendar. First week in March in San Diego. Look forward to seeing you there. BTW, do you sing karaoke? Icing on the cake!