How to insert data to other table which is not on the same block please? [message #214424] |
Tue, 16 January 2007 07:23  |
Smith_X
Messages: 56 Registered: January 2007
|
Member |
|
|
Hello,
Short Question.
I want to update data in another table which it's not in the same block that I working on. Are there any way to do that?
The Whole Story.
In example, I have twos data block and two forms to make a purchase order document. (Purchase Order (PO) is a master-detail and has a relation with POI table.)
Next, when user create a new po, I want my system to populate the log in my log table. Well, how I could do that, please?
As far as I try to think.. I should make a new block "LOG" which it is handle for the LOG table. Then, when I try to save a PO. I have to create a Pre-Insert trigger in my detail block to do something like following...
1. Go_block(LOG)
2. create all data that I would like to save in LOG Table
3. Go_block(PRI)
Do I understand correct please?
One more question, should this logic work with my inventory movement table, please?? I need to keep track for every in-out raw material and inventory unit, too.
Regards,
Smith
[Updated on: Tue, 16 January 2007 07:39] Report message to a moderator
|
|
|
|
|
|
Re: How to insert data to other table which is not on the same block please? [message #214531 is a reply to message #214525] |
Tue, 16 January 2007 20:38   |
Smith_X
Messages: 56 Registered: January 2007
|
Member |
|
|
Thanks very much for your reply David.
I will try to apply your tip for my first question today.
For the second question, I'm sorry that I do not explain more detail enough. The problem that I face in second question is much like to first question. The example is.. I have Goods Received Document which use when supplier transfer an inventories to company. next, I use Goods Received Form to track inventories that company received. The problem is that when company received the inventories I want to update data in database another three tables
1. Table Inventory Movement
2. Table Inventory Balance for associated Branch
3. Table Balance of Master Inventory
The first table design to keep records in-out of inventory by transactions. The second inventory keep update the balance of inventory in each branch. (Each received documents will affect not more than one branch.) Finally, the master inventory is a table that like table number 2 but update the whole number of inventory in company. The data in third table will use to represent for very top view of the whole inventory in company.
I need to update so many table to prevent the long time calculation when I would like to prepare the inventory on-hand report.
Next, the inventory that I received are shown in "detail" of Goods Received Document. Can I use the same method that Dave reply in the first question please? Just only insert??? Do I need any other specific command please?
[Updated on: Tue, 16 January 2007 20:43] Report message to a moderator
|
|
|
|