falkaholic Posted January 21, 2002 Posted January 21, 2002 I have a database that does an invoice. The list of items in the invoice is a portal to a listitems DB which is in turn related it a item DB (for item discription, amount in stock,prices etc). So it looks like this |Items| ---> |listitems| --P-- |Invoice| I want to be able to subtracht the quantity from the invoice from the item database. Right now i have it loop thought the portal with go to row ( first) etc. and with every item it runs a script in the itemlist DB to take the quantity off in the items DB. The problem i found is that when i run a script it resets the go to row and it takes all the quantitys off the first item. I just tried doing a manual count with a global and it still does that same. Any suggestions?
Vaughan Posted January 22, 2002 Posted January 22, 2002 Do all of the printing and stuff in the related database where the items are records. This gets rid of the portal which is the cause of a lot of problems. It's also a lot easier when you get the hang of it. Even FMI acknowledges that portals are not a great solution for printing. see TechInfo Article 103675.
falkaholic Posted January 22, 2002 Author Posted January 22, 2002 I'm not sure what you mean. Do you mean make the the lineitems DB have the invoice?
Vaughan Posted January 23, 2002 Posted January 23, 2002 Yes. Because when you think about it, the guts of the invoice *is* the line items. Bring the customer info in through a relationship back to the master database.
falkaholic Posted January 23, 2002 Author Posted January 23, 2002 I've have given it some thought, i could call a script from the invoice in the lineitems to go through and take off the quantity. but there is no easy way to find which lineitems to take off because it won't be able to tell with invoice is complete; unless i do a find or loop through each item. Which would be slow since the lineitems will have 300,000 + records. hmmm or could i have a flag in each lineitem so thee script won't take off twice.....
Vaughan Posted January 23, 2002 Posted January 23, 2002 Can't you use a calculation field to calculate the stock?
falkaholic Posted January 24, 2002 Author Posted January 24, 2002 thanks, Might be able to. but in the mean time i figured something else out. In my loop I wasn't calling Go to Related Row, which i though would be implicit after Go to Portal Row. It all work ok now.... well.. pretty much. The loop does that last item twice for some reason.
Recommended Posts
This topic is 8341 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