Two inventory fields

On Item List (Form 31) i need two Inventory fields, one of them filtered by Location X (Constant value) and other one is without filter. How to do that? Any ideas?

Since I didnt see in your profile in what area are you working the text bellow can be targeted either to you or your NSC. Add a global variable. Then create a function which gets the data from the Item Ledger, filtered by Location X and assign the result to the global variable. You should call this function in OnAfterGetRecord trigger and then just put the variable on the form /as TextBox/ Control. good luck.

Simply add the Inventory Field (Field 68) to the form. Use Flowfilter (Shift+F7) to see the inventory on a given location. Be aware - adding flowfields will slow down the performance og the form.

This is okay, but as I understood what Annar said is that he needs TWO fields, one with Inventory and another one with Inventory at a specific location.

Well, then add a new field with the relevant location-filter. This will enable drilldown functionality.

Made global variable of record, textbox etc etc. Everything comes thru but the value of inventory. “No.”, “Unit price” etc are there but no “Inventory”-value and even without any filters. Am i missing something in the parameters? Items2 is the global variable, InventoryText and Test are the textboxes. Items2.Find(’-’); Items2.SETFILTER(Items2.“No.”,“No.”); InventoryText := FORMAT(Items2.“Inventory”); Test := FORMAT(Items2.“No.”); ---- The Test textbox has it’s value, InventoryText has 0 all the time, even tho in the main window there is different value. Designers guide manual is not much helpful also. Annar

Items2.GET(“No.”) Items2.setfilter(“Location filter”, ); items2.calcfields(“Inventory”); {it can be variable of type Decimal} InventoryDecimal := Items2.Inventory; Textbox’s “Source Expression” property should be set to InventoryDecimal. And all that code put in the OnAfterGetRecord Trigger.

You need a CALCFIELDS(Inventory). A much simpler solution, as mentioned earlier, is to make a copy of the Inventory field and apply the location-filter directly on this new field.

Thnx! It works! Is there any better manual than Application Designers Guide and CAL Programming (which still seems to be introduction) available that i should read thru? I seem to be missing quite alot. :stuck_out_tongue: Annar

ADG and CAL Programming are the only manuals provided for C/SIDE development. They are actually quite good, but you should 1.Read them thoroughly 2…and never be surprised that there is something in reality which is not described in the manuals.

Actually just about everything is in the manuals, but you do have to read them in detail. Its no good to just skim through them. Spend the time and read them cover to cover.

I had to do the same thing, create two different inventory fields. I added a new field to the ITEM TABLE. I matched all the properies that the regular quantity on hand had except i added at the end of the calc formula , Location Code=FILTER(NY)