Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Lookups slowing app
Wed, Jan 28 2009 11:49 AMPermanent Link

David Darlison
I have a c/s app that uses 3 lookups on an items table from a parts table.
I insert a new record from the mainform and if I have set the lookupcache to
true on all the lookups it can take 3mins for the orderform to show over a wan. If I disable
the lookupcache to false it takes seconds, but scrolling the iems grid is slow along
with entering new items and alculating fields.
I have trawled through previous posts on lookups and most say they should be avoided
when using c/s. I appreciate this but I am not sure how to replace them. Here are
my curent steps.
1. Open orderform to insert new order
2. Enter order details (customer etc.)
3. Enter items grid (linked to items table) to insert new items
4. Enter partno in first column of items grid which in turn looks up
part description, unit cost etc.
5. Tab to next item to insertetc.
6. Save items and order with save button

Any help with replacing the lookups would be much appreciated.
Wed, Jan 28 2009 12:03 PMPermanent Link

"Robert"

"David Darlison" <dave@ukweigh.net> wrote in message
news:D20D046E-43D0-4BAA-9DBA-F36E9FDC786E@news.elevatesoft.com...
>I have a c/s app that uses 3 lookups on an items table from a parts table.
> I insert a new record from the mainform and if I have set the lookupcache
> to
> true on all the lookups it can take 3mins for the orderform to show over a
> wan. If I disable
> the lookupcache to false it takes seconds, but scrolling the iems grid is
> slow along
> with entering new items and alculating fields.
> I have trawled through previous posts on lookups and most say they should
> be avoided
> when using c/s. I appreciate this but I am not sure how to replace them.
> Here are
> my curent steps.
> 1. Open orderform to insert new order
> 2. Enter order details (customer etc.)
> 3. Enter items grid (linked to items table) to insert new items
> 4. Enter partno in first column of items grid which in turn looks up
> part description, unit cost etc.

I understand from your post that this is for new orders, that you start with
an empty grid and you add line items one by one.

On exiting col 1 of the grid (that is, after you have a part number), do a
query to bring up the rest of the data and populate the appropriate fields.
Have the query already prepared (explicit prepare) so that it is ready to go
as soon as you enter each part number (a parameter) . Of course if
query.isempty is true, you have an invalid part number.

This should work fine in both file sharing and c/s.

Robert

> 5. Tab to next item to insertetc.
> 6. Save items and order with save button
>
> Any help with replacing the lookups would be much appreciated.
>

Wed, Jan 28 2009 1:10 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

David,

In addition to what Robert suggested, in case you don't want to use SQL,
just replace the 3 lookup fields with 3 calculated fields; then use a
single Finkey inside the OnCalcRecords to retrieve the 3 values.

--
Fernando Dias
[Team Elevate]
Wed, Jan 28 2009 1:17 PMPermanent Link

David Darlison
"Robert" wrote:

I understand from your post that this is for new orders, that you start with
an empty grid and you add line items one by one.

On exiting col 1 of the grid (that is, after you have a part number), do a
query to bring up the rest of the data and populate the appropriate fields.
Have the query already prepared (explicit prepare) so that it is ready to go
as soon as you enter each part number (a parameter) . Of course if
query.isempty is true, you have an invalid part number.

This should work fine in both file sharing and c/s.

Robert

Thanks Robert.
I was thinking along those lines.
But what about editing items that have previously been posted, how
do I view the 'lookup' fields if I don't exit col 1?
David  
Wed, Jan 28 2009 1:41 PMPermanent Link

"Eduardo [HPro]"
Fernando (and David)

Even if he wants to use SQL, I will suggest the use of OnCalcFields instead
of LookupFields. It is faster.

Eduardo

Wed, Jan 28 2009 2:25 PMPermanent Link

"Robert"

"David Darlison" <dave@ukweigh.net> wrote in message
news:FD08FF76-93F4-4F8B-99B6-06D72BB54383@news.elevatesoft.com...
> "Robert" wrote:
>
> I understand from your post that this is for new orders, that you start
> with
> an empty grid and you add line items one by one.
>
> On exiting col 1 of the grid (that is, after you have a part number), do a
> query to bring up the rest of the data and populate the appropriate
> fields.
> Have the query already prepared (explicit prepare) so that it is ready to
> go
> as soon as you enter each part number (a parameter) . Of course if
> query.isempty is true, you have an invalid part number.
>
> This should work fine in both file sharing and c/s.
>
> Robert
>
> Thanks Robert.
> I was thinking along those lines.
> But what about editing items that have previously been posted, how
> do I view the 'lookup' fields if I don't exit col 1?

I'm assuming that the grid displays data fields from a dataset. Once those
fields have been populated, they are there for the duration. Unless you
change part number, which would force a repopulation of the fields, whether
it is a change or a new line item.

But it is possible I don't understand your app. I'm viosualizing something
like

Line Items Dataset

PartNumber (entered by operator)
Fielda (automatically generated from part number)
Fieldb (ditto)
Etc.

A grid displays all three fields. Columns 1 and 2 are readonly. When the
user keys in a part number and exits column 1, you populate via the query
columns 2 and 3. That should work for both new items or change in part
number.

The advantage over calculated fields (not a great advantage, but some) is
that unless part number changes, once you got the values for fielda and
fieldb one time, you're done. Calculated fields get recalculated often (see
documentation).

Robert

> David
>

Thu, Jan 29 2009 2:48 AMPermanent Link

David Darlison
>But it is possible I don't understand your app. I'm viosualizing something
>like

>Line Items Dataset

>PartNumber (entered by operator)
>Fielda (automatically generated from part number)
>Fieldb (ditto)
>Etc.

>A grid displays all three fields. Columns 1 and 2 are readonly. When the
>user keys in a part number and exits column 1, you populate via the query
>columns 2 and 3. That should work for both new items or change in part
>number.

Robert,

I have 7 fields in the items table, just 4 I need to save (orderno,itemno,partno,qty).
2 fields I need to display in the grid as a referece fro the operator (partdescription, partcost)
and 1 field which is calculated ExtPrice(partcost * qty).
If I do not save say the partdescription (as I do not need to) how do I view it if I refer to
a previous order?

Regards
David  
The advantage over calculated fields (not a great advantage, but some) is
that unless part number changes, once you got the values for fielda and
fieldb one time, you're done. Calculated fields get recalculated often (see
documentation).

Robert

> David
>
Image