Scripting

  • 1.  I have a script that runs on table post-read for C

    Posted 07-14-2015 13:31
    I have a script that runs on table post-read for CI_Item. It basically does a mess of conversions and writes to UDFs in IM_ItemWarehouse. It works fine in Item Maintenance but Item Inquiry does not display the updated UDFs. Program Trace Window shows the same debug for both tasks and the write is (supposedly) successful. Can I get Item Inquiry to behave like Item Maintenance in this example or am I better off forcing users to go to Item Maintenance and doing some field level security scripting?


  • 2.  RE: I have a script that runs on table post-read for C

    Posted 07-14-2015 13:42
    I think that Item Inquiry uses IM_ItemInquiry_UI, which is read-only, while Item Maintenance uses IM_Item_UI. You'll probably want to force a connection to IM_Item_UI.


  • 3.  RE: I have a script that runs on table post-read for C

    Posted 07-14-2015 14:09
    Breck what version is this for? In Item Inquiry is the script working but not updating the UI or is the script not working at all? I would guess the latter because your Security Access (oBusObj.SecurityAccess) in an Inquiry screen is 0 which is basically the same as View only permission in Role Maintenance. So the bigger question is what is the bigger picture purpose of writing to UDFs in IM_ItemWarehouse (maybe there's another way)?


  • 4.  RE: I have a script that runs on table post-read for C

    Posted 07-14-2015 14:16
    And I'm wrong. It is Version 2014.4.


  • 5.  RE: I have a script that runs on table post-read for C

    Posted 07-14-2015 14:16
    This is for version 2015. The script debugging says it is working (or at least not failing). I would say it is not updating the UI. This is a super special drywall client who sells, stocks and views everything in sheets but all transactions have to be converted to feet. They aren't using unit of measure conversions, the footage is never actually visible in the system, but the end result is that they sell 50 sheets with a unit price of $350 and the extension ends up being $840 because of the scripted conversion. It is totally odd but we have it figured out except for this issue. When they look at Item Inquiry, they need to see converted numbers and not **actual **quantity available, sold, etc.


  • 6.  RE: I have a script that runs on table post-read for C

    Posted 07-14-2015 15:02
    I understand now! If you're trying to replace the values on the listbox on the Quantity tab for UI purposes only, that is not possible with scripting AFAIK. What about this (for part of the answer I'll pretend you didn't say v2014) : In 2015 you can create a UI script to highlight the whole row in black. Then in 2015 or earlier, create a Customizer button to pop a dialog - you could place CI_Item UDFs on there that will represent a temporary copy of the IM_ItemWarehouse UDFs. You could have a script fire off when the button is pressed that would copy the IM_ItemWarehouse UDF values to these UDFs on the dialog, except instead of using SetValue() you try oUIObj.InvokeChange() to write to the screen. YOU'LL HAVE TO TEST IT. In theory you could also pop the dialog on your existing Post-Read script so they see what they want right away and they never had to press a button. And if the Quantity info was displayed in a grid instead of a listbox you could try InvokeChange() right on the grid. In fact there is a grid at the bottom called GD_PQTYTOTALS at the bottom but it's disabled. In v2015 you can enable the grid :( Not to curb your enthusiasm but all of this can be done with a mod regardless of version.


  • 7.  RE: I have a script that runs on table post-read for C

    Posted 07-15-2015 22:04
    Thanks for the suggestions! @AlnoorCassim - I can't believe this stuff just comes off the top of your head. Wowza. If they freak out about being in Item Maintenance then I will just have to upgrade them and take advantage of the wonders 2015 can offer. Thanks again!