June 11, 200718 yr Im not sure if this is where thsi question should be posted but I am sorta stuck. I have no formal FM training and i am trying to do something here and I havent been able to figure it out. I have a simple inventory database that I made. I have a field called "In Stock" that shows how many items of a certain product I have in stock. I want to always have so many of each item in stock.. I want a minimum number of items and a maximum number. when the items reach the minimum I want to order more of those items. so what I have done is made two new fields "Min" and "Max" Min and Max will be filled it with preset numbers. They will vary from item to item. What I wouild like to do is to be able to make a button that when I press it, will print all the products out that have reached or gone below the min so I have a list of items I must re-order. Of course each product is a record. and i have about 250 records. Im so lost. please help?
June 11, 200718 yr Create a calculation flag_below_min = if( on_stock < min ; 1 ) Now create a script which searches for ones in this field and shows a list. -jens
June 11, 200718 yr Author what if the min is different for each record? I mean min could be 2.. it could be 3 4 5 or even 12... some stuff i wanna keep more in stock than others.
June 11, 200718 yr where is the problem? min can be different for each record as well as on_stock. if you search those ones where the individual difference is negative, everything is fine! jens
June 12, 200718 yr Author i guess I know a lot less than I realized because you are speaking greek to me lol
June 12, 200718 yr +-----+-----+-----+-----+ |stock| min | calc| flag| +-----+-----+-----+-----+ | 120 | 100 | 20 | 0 | | 120 | 110 | 10 | 0 | | 130 | 200 |-70 | 1 | | 200 | 90 |110 | 0 | | 250 | 300 |-50 | 1 | +-----+-----+-----+-----+ calc = stock - min flag = if ( calc < 0 ; 1 ) Does this help? Jens
June 12, 200718 yr You could just make a Unstored Calculation Field, we'll name it Product status. Make this the calculation. Case (GetAsNumber(In Stock) < GetAsNumber(Min);"Order" ;GetAsNumber(In Stock) > GetAsNumber(Max);"Too Many" ; "Good" ) Then you can search quickly for the items you need to order if they are below what you designate as the minimum or above the maximum. Michael
June 14, 200718 yr Author thankyou for the diagram jenns.. I understand better now. my next question is this though.. again sorry for being such a newb to fmp... but... the calculation... would I associate that to a button? I guess im not sure where to enter the calculation at... do I associate it with a field? a button? somewhere else? or am I not making any sense? sorry for so many questions.
June 14, 200718 yr Author Ive got this If ${canton-group_inv}:In Stock: ≤ ${canton-group_inv}::Min but I dont know how to put the "then" I want it to be If ${canton-group_inv}::In Stock: ≤ ${canton-group_inv}::Min then Order = 1 but i cant see how to add the "then Order = 1" Edited June 14, 200718 yr by Guest
June 14, 200718 yr Author Ok i think Ive got a good start here now... however with what I am doing.. I need to make my field "order" have its data auto entered... I cant figure this out... I cant see how I can make the auto entered data be determined by a script.. and when I try to do it by a calculation its not working for me. I have a script written that will find all the records where order = 1 but i just cant figure out how to get order to =1 automatically based on what the field "Min" is. Id like the data entered in "Order" to be a 1 if InStock <= to Min. god Im getting more lost the deeper I dig and the further i get lol
June 14, 200718 yr I tried to attach a sample file but it won't(Hangs after I choose the file) upload for some reason. You can do it via a calculation. with a single field no scripts. I moved away from populating fields with "1" for such things as this. Make a new field named Product Status. As soon as you have made the field on the right hand side click in the dropdown and make it a calculation and in the calculation window click on Storage options and make it unstored. Put this calculation in. Case (GetAsNumber(your in stock field) < GetAsNumber(your min stock field);"Order" ;GetAsNumber(your in stock field) > GetAsNumber(your max stock field);"Too Many" ; "Good" ) This field will automatically Show "Good" if your stock is within the boundaries you designate with your Max field and your Minimum field. If you have more than the Max it will say "Too Many". If it is below your Minimum field it will say "Order" I think you are just making it a little harder then need be, which filemaker tends to make us do sometimes. Michael
June 14, 200718 yr Author Thank you! that worked like a charm! I see what you mean too.. I definitely was making it much harder than it had to be. Thank you once again :
Create an account or sign in to comment