Newbies martin1006 Posted December 22, 2015 Newbies Posted December 22, 2015 I need to have a solution to update my inventory list. In my example I have a table to produce with four legs and one table surface. When 100 tables are produced on day one it means 400 table legs and 100 table surfaces are used. I know I can add also new transactions in the transaction table but then it means the actual stock amount might not be always up to date when users forget to update the Amount_out in the transaction lineitems. How can I add transaction_lineitems for both the 400 table legs and the 100 table surfaces when I add the amount 100 into the amount field in the production line-items Thanks in advance for the answers. Inventory.fmp12.zip
Wim Decorte Posted December 22, 2015 Posted December 22, 2015 I don't see where you input "100 tables"... You would need a Bil-of-materials (BOM) table for the products so that you can retrieve that 1 table is broken down in 1 table surface and 4 legs. With that in hand it will be easy to take the input of "100 tables" and break it down in 400 legs and 100 surfaces and create line items for each breakdown item in your BO table.
Newbies martin1006 Posted December 22, 2015 Author Newbies Posted December 22, 2015 Thanks for your answer I did not add the amount of 100 in the production_lineitems yet. In the projects layout you can see the portal of these production lineitems. So as I understand I have to make a separate BOM table. How do I get the table separated in the table surface and the 4 legs at the moment I add the amount of 100 in the production lineitems?
Wim Decorte Posted December 22, 2015 Posted December 22, 2015 I envision a scripted workflow like this: - you enter "100" in the production line items and you also select "table" as the product - the script finds the product "table" in the products table and checks its BOM, seeing that one table consists of one surface and 4 legs - the script loops through each of the BOM items and creates inventory transactions for each one (taking the BOM qty (1 for surface, 4 for legs) and multiply that by the # of products produced (100)
Newbies martin1006 Posted December 22, 2015 Author Newbies Posted December 22, 2015 I understand what you mean. Am I right I can do this to use a local variable to enter in the fields for the new transaction lineitems?
Wim Decorte Posted December 23, 2015 Posted December 23, 2015 Sure... any scripted workflow can temporarily store data in local variables so that you can re-use it later in the script.
Newbies martin1006 Posted December 23, 2015 Author Newbies Posted December 23, 2015 I know how to use the variables and this works. For your understanding. I'm not looking for an overal solution yet for the inventory. I have one found set of 5 records in TABLE_A. I need to make 5 new records corresponding to those 5 records in TABLE_B. This part I can not get done. I tried with a loop but then the loop don't stop. If I try without a loop only one of the 5 records from TABLE_A will be made in TABLE_B
Wim Decorte Posted December 23, 2015 Posted December 23, 2015 The script would look like this (pseudo code) (layout based on Table_A) set variable( $max = get(foundcount)) <do whatever you need to do in A to collect the data> Go To Layout (some layout based on Table_B) set variable($counter = 1) Loop New record < do whatever you need to do in the new records > set variable($counter = $counter + 1) Exit Loop If( $counter > $max) End Loop
Recommended Posts
This topic is 3258 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