Nestor Posted April 29, 2014 Posted April 29, 2014 Good Morning all, I need to come up with a way to make an item and total qty be auto consumed by a value that the user enters. example item abcde has 152 qty's. if I type 10 into a field I need the script to create 16 lines. each line will have abcde 10, except for the last one that will have 2 as the qty. Any ideas of examples I should look at. thank you
comment Posted April 29, 2014 Posted April 29, 2014 We need some table/field names here, so assuming an OrderItems table with fields for: • OrderItemID (auto-entered serial) • Qty (152) • PackSize (10) and a PackSlips table with fields for: • PackSlipID (auto-entered serial) • OrderItemID • Qty the script could do something like (untested): Set Variable [ $itemID; OrderItems::OrderItemID ] Set Variable [ $itemQty; OrderItems::Qty ] Set Variable [ $packSize; OrderItems::PackSize ] Go to Layout [ PackSlips ] Loop Exit Loop If [ not $itemQty ] Set Variable [ $qty; Min ($packSize ; $itemQty) ] New Record Set Field [ PackSlips::OrderItemID; $itemID ] Set Field [ PackSlips::Qty; $qty ] Set Variable [ $itemQty; $itemQty - $qty) ] End Loop Go to Layout [ original layout ] 1
Recommended Posts
This topic is 4251 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