Scripting

  • 1.  I'm trying to write a script that populates a UDF

    Posted 02-15-2016 13:11
    I'm trying to write a script that populates a UDF on Item Transaction Entry Tier Distribution (specifically multi-bin tier distribution). Is this only possible by using the Set/GetStorageVar? I have a script written and it retrieves the values from CI_Item correctly, does its math correctly and even says is writes to the UDF but nothing is ever actually written to the UDF. Do I have to go the storagevar route?


  • 2.  RE: I'm trying to write a script that populates a UDF

    Posted 02-16-2016 13:03
    Breck - The reason for needing to use Set/GetStorageVar is when you have 1 script in a Tier Dist object and another script in the Line Detail object. Unless you use a UDT in common for both objects (one writes to it, the other reads from it), Set/GetStorageVar is how to share variables between the 2 scripts. However if you're just dealing with a single script and writing to a Tier Dist UDF that should work. One thought is if doing this as a Post-Write event you would need to refresh the Tier Dist grid I think.


  • 3.  RE: I'm trying to write a script that populates a UDF

    Posted 02-17-2016 06:42
    I think MB requires you to WriteLine and CommitDistributionRow (something like that) in order to save the record.


  • 4.  RE: I'm trying to write a script that populates a UDF

    Posted 02-17-2016 07:46
    Thanks for the help. It sounds like I shouldn't need SetStorageVar and I added oScript,.LinesAdded = 1 and oScript.LoadGrid. I'm still getting a return of 1 on the SetValue of my UDF but nothing shows up in the UI or the data table. @SteveIwanowski - are those commands oScript,.WriteLine() and oScript.CommitDistributionRow()? I haven't found them in my documentation yet...still looking...


  • 5.  RE: I'm trying to write a script that populates a UDF

    Posted 02-17-2016 07:55
    ACS MB, right? It wouldn't be oScript, it would be the ACS object under oBusObj. I'll try to find the script I wrote later today, but I ended up finding it in the examples at the end of the MultiBin manual. I think the ProvideX code shows the CommitDistribution, but not the VBScript (Ron said he missed it).


  • 6.  RE: I'm trying to write a script that populates a UDF

    Posted 02-17-2016 08:04
    I have that manual! I will see what I can take from that and report back. Thanks so much!


  • 7.  RE: I'm trying to write a script that populates a UDF

    Posted 02-17-2016 09:03
    I think have it. The script is attached to IM404_TrasactionTierDist so I can bypass calling the MB object. I moved the script to be pre-write instead of post-write and now it appears to be happy. Thanks for the help!