Jump to content

yet another portal looping problem


falkaholic
 Share

This topic is 7209 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.....

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 7209 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.