AnsweredAssumed Answered


Question asked by Matty_1 on Feb 28, 2014
Latest reply on Mar 5, 2014 by Matty_1




     Hi Guys,

     I'm completely confused and before I get into details and provide scripts I will give a general overview in hopes that it's a simple fix.  If more info is needed I suppose we can cross that bridge then.

     So my issue is this: I have three fields, Quantity, Percentage and InventoryBalance.  The user enters a percentage into the percentage field.  Based on the percentage chosen, the quantity field auto-enters a calculated quantity.  Finally, based on the results of the quantity, Inventory balance auto enters another calculation removing the quantity from the current inventory.  I do this so that we can go look at what inventory was at the time of a particular transaction.  Clear as mud?!

     What is strange is this, if I leave out a particular set of script triggers in the OnObjectEnter and OnObjectSave the InventoryBalance field seems to update only occasionally and incorrectly.  When both triggers are in it works 100%, no matter what.  The triggers I use are universal triggers I put in every single field in my entire database.   It verifies if changes have been made when records are closed and if so it asks for an explanation.

     The strangeness continues ... the issue with this one particular layout is the danger of accidentally going into negative inventory so I sought to create a script which would verify and help the user calculate percentages if need be.  I put this trigger in OnObjectValidate.  I now seem to have the same issue, my InventoryBalance field doesn't update properly and I do't have a hot clue why it would do that.

     Any ideas?!