klesch
10th July 2003, 14:48
Is there any way to use other table's index for sorting main table's record in display / maintain session?

An example:

I have a custom table containing production orders from tisfc001 and some other things. I need to make a maintain session for this table that will have records sorted by tiitm001._index4.

By the way: I preffer not to have a mirror field from tiitm001 in my custom table since it can be updated in many different ways.

Any ideas?

Baan IV c4, that is.

rupertb
10th July 2003, 17:23
Hi Klesch I think you'll have to mirror the item's search key in your custom table how many items are there on your item master? Can't you quickly synchronize your custom table/item master before a lookup is done?

Good luck...
Rupert

klesch
10th July 2003, 18:52
I'm affraid that I will really have to do that. I'm talking about 50.000 records in tiitm001 and about 30.000 in my custom table. It should only take a while the first time the session is run.

tjbyfield
11th July 2003, 02:52
I don't think it would take very long to run an update program to synchronise these tables.

It is unlikely that the fields in index 4 would change very much. There is only one field other than the item number and this 'search key' field is probably very static. The update sql should run with the indexes only of the database (at least with oracle it could) so if there are no changes it will run like greased-lightning.

If Item Maintenance is centralised/controlled as it is in a lot of organisations, the synchronise session could be also be controlled by that group and perhaps also run every night just to be sure.

Alternatively, if you do have changes to 'seak' and/or the item maintence is not centralised and the update runs very quickly you may be able to put it in the before program section.

(...assuming item is a key field in your table tixxxnnn
from tiitm001, tixxxnnn for update
where tiitm001._index1 = tixxxnnn
and tiitm001.seak <> tixxxnnn.seak
selectdo... )

rupertb
11th July 2003, 10:32
50000 records on your item master what are you manufacturing - the space shuttle? I see your problem Klesch rather than performing the update in your program why not using database triggers to keep the mirror intact. I know there are other issues and most shy away from building in business logic at the database level but it might pay-off here.

Regards,
Rupert

tjbyfield
11th July 2003, 12:08
Database Triggers are fine. However they are outside of Baan and as such you would loose the benefit of the very good development tools/component management system to keep track of this extra code without which you system would not function correctly.

As an alternative to a database trigger you could add a small customisation the the item maintenance session to initiate your update session ["zoom.to(..)] when ever an item is added/deleted or the seak field changed.

Terry

rupertb
11th July 2003, 12:28
Good thinking Terry, but I wonder if Klesch has the source for itm0101? Aren't there issues with triggers when performing conversions to runtime in Baan on the tables. We are shortly going to be trying out their usefullness...
Regards,
Rupert

kbartelds
11th July 2003, 12:45
Hi,

You can try to have an exchange do the job for you, maybe based on audit. The exchange scheme can run continiously in a job.

Regards,
Klaas