6 Replies Latest reply on Aug 6, 2009 1:06 PM by kunaaldesai

    Inset calculated value from  custom dialog

    kunaaldesai

      Title

      Inset calculated value from  custom dialog

      Post

      Hey guys,

                      I am trying to insert some value from custom dialog and have that value being added to  a field's recent value.

       

      For example : I have a field called inventory and it has 40 items right now. Now what I want is I want use to enter some value that can be added to that field's value.

       

      I  thinking to use custom dialog to take user input but custome dialog just lets me enter field value.  I mean  in this case what ever the user will enter will replace old field value but I want new value to be added in old value NOT replace it.

       

      can any bod help please?

       

      Kunal

        • 1. Re: Inset calculated value from  custom dialog
          mrvodka
            

          I suggest you user global fields in your custom dialog to capture the user data. Then in your script you can append to your current field by using a set field.

          Set Field [ Field; Field & gUserEntry ]

           

          You can add a pilcrow if you want a carriage return between values.

           

          Set Field [ Field; Field & ¶ &  gUserEntry ]

           

          • 2. Re: Inset calculated value from  custom dialog
            etripoli
              

            Or, in this case, use the script to add/subtract the values.

             

            On a side note, Inventory tracking seems to be a recurring theme, and most people try to solve it in the same way, by manually incrementing/decrementing the quantities in stock.  It's almost always better to use an Inventory Log table to track quantities added to, or removed from Inventory, and then use this table to update the total quantity available.  Just my 2¢.

            • 3. Re: Inset calculated value from  custom dialog
              philmodjunk
                

              To expand on Etripoli's suggestion...

               

              Think of your inventory log as a check register, but instead of logging deposits and withdrawals of $$, you are adding and removing items from inventory. Your log not only gives you current inventory counts, it also gives you a history of how your inventory levels have changed over time and this can be a valuable management tool for adjusting restocking points and other such details.

              • 4. Re: Inset calculated value from  custom dialog
                kunaaldesai
                  

                 First of all, I am really sorry for the late reply guys, but I was offline whole say yesterday.

                 

                @ MR. Vodka --> As you said, I tried saving values in a global variable and the method worked. Thankyou very much for that .

                 

                @ Etripoli and Phil-->  Guys, I understood that the concept of keeping a log would  help me but how can I make a log file? I mean should I store old value of the variable somewhere whenever it is updated?

                 

                Kunal

                • 5. Re: Inset calculated value from  custom dialog
                  philmodjunk
                    

                  You set your log up in a table where each record documents the change in inventory for a specified item and use summary fields to compute total amount on hand.

                   

                  You'd have fields such as:

                   

                  Date, Material ID, Amount added, Amount removed, cBal (Amount added - Amount removed), sBalance (Summary, total of cBal or possibly a running total of cBal)

                   

                  Each time you log a change, you create a new record and fill in the appropriate fields.

                   

                  To see the total on hand for a given item, perform a find for that item so that only those records are in your found set.

                   

                  Too see the total on hand for all items, create a summary report and use sorting to group all your records by Material ID.

                  • 6. Re: Inset calculated value from  custom dialog
                    kunaaldesai
                       Ahh I see that could be a helpful thing. Thank you Phil.