Jared867 Posted June 11, 2007 Posted June 11, 2007 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?
jteich Posted June 11, 2007 Posted June 11, 2007 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
Jared867 Posted June 11, 2007 Author Posted June 11, 2007 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.
jteich Posted June 11, 2007 Posted June 11, 2007 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
Jared867 Posted June 12, 2007 Author Posted June 12, 2007 i guess I know a lot less than I realized because you are speaking greek to me lol
jteich Posted June 12, 2007 Posted June 12, 2007 +-----+-----+-----+-----+ |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
AudioFreak Posted June 12, 2007 Posted June 12, 2007 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
Jared867 Posted June 14, 2007 Author Posted June 14, 2007 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.
Jared867 Posted June 14, 2007 Author Posted June 14, 2007 (edited) 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, 2007 by Guest
Jared867 Posted June 14, 2007 Author Posted June 14, 2007 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
AudioFreak Posted June 14, 2007 Posted June 14, 2007 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
Jared867 Posted June 14, 2007 Author Posted June 14, 2007 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 :
Recommended Posts
This topic is 6433 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now