August 17, 200817 yr How can you import only found records from one table to another. I'm transferring an "Order" with its accompanying "orderItem" records to a different table pair. I can isolate the orderItem records for import, no problem, but every orderItem record is imported, even though only the related ones are found, creating a bunch a of orphan orderitem records without a an fk of any kind. My stinky workaround "finds" the orphan orderitems and deletes them. So I wish I could just selectively import to begin with. Any ideas?? Thanks Chas
August 17, 200817 yr You can change your profile by going to MY PROFILE >> Control Panel >> FileMaker Questions (at the bottom of the list). Lee
August 17, 200817 yr Assuming the tables are in the same file... and in the same window... the source table for the import has to have the same base table occurrence as the found set.
August 17, 200817 yr How can you import only found records from one table to another. I'm transferring an "Order" with its accompanying "orderItem" records to a different table pair. I can isolate the orderItem records for import, no problem, but every orderItem record is imported, even though only the related ones are found, creating a bunch a of orphan orderitem records without a an fk of any kind. My stinky workaround "finds" the orphan orderitems and deletes them. So I wish I could just selectively import to begin with. Any ideas?? Thanks Chas How are you isolating the orderitems? Are you doing this as 1 import or 2? I would think it would be as 2 and I've never had a problem with: Find [] Export Records and only getting an export of the found set.... Can you post the script steps?
August 18, 200817 yr Author Assuming the tables are in the same file... and in the same window... the source table for the import has to have the same base table occurrence as the found set. Yeah....I think this is happening. But I'm missing something. There is a relationship between the tables. Basically I'm copying several "Prospect" line items and changing their fk_OrderID so that they line up with the new Order - then those orderitems get imported. But this still imports all prospectItems instead of limiting the import to the "temps" Transfer-3-Find ProspectItems Commit Records/Requests [ No dialog ] Go to Layout [ “PI_prospectItems -pi_orderItems” (PI_ProspectItems_TOG) ] Show All Records Replace Field Contents [ PI_ProspectItems_TOG::temp; Replace with calculation: "" ] [ No dialog ] Copy [ pi_Prospect::gProspectID ] [ Select ] Enter Find Mode [ ] Paste [ PI_ProspectItems_TOG:_fk_IDProspect ] [ Select; No style ] Perform Find [ ] Go to Record/Request/Page [ First ] Loop Set Field [ PI_ProspectItems_TOG::temp; ORD__Orders_tog::gOrder ] Go to Record/Request/Page [ Next; Exit after last ] End Loop Commit Records/Requests [ No dialog ] Transfer-4-Import new OrderItems form ProspectItems Go to Layout [ “orderitems/prospectitems” (OI__OrderItems_tog) ] Import Records [ Source: “file:Hanover_Strings”; Target: “OI__OrderItems_tog”; Method: Add; Character Set: “Mac Roman”; Field Mapping: Source field 2 import to OI__OrderItems_tog::_fk_IDCustomer Source field 4 import to OI__OrderItems_tog::_fk_IDProduct Source field 5 import to OI__OrderItems_tog::category Source field 6 import to OI__OrderItems_tog::company Source field 8 import to OI__OrderItems_tog::description Source field 9 import to OI__OrderItems_tog::flag Source field 10 import to OI__OrderItems_tog::flagClosed Source field 11 import to OI__OrderItems_tog::gSearchParam Source field 12 import to OI__OrderItems_tog::has_a_serial_number Source field 13 import to OI__OrderItems_tog::list_price Source field 14 import to OI__OrderItems_tog::name Source field 16 import to OI__OrderItems_tog::net_price Source field 17 import to OI__OrderItems_tog::Quantity Source field 19 import to OI__OrderItems_tog::selling_price Source field 20 import to OI__OrderItems_tog::serial Source field 21 import to OI__OrderItems_tog::specialOrder Source field 23 import to OI__OrderItems_tog::_fk_IDOrder ] [ No dialog ] Commit Records/Requests [ No dialog ]
August 18, 200817 yr Author Hi Cabinetman, Yeah I have no problems isolating an export. Found set just exports the found records....it is importing a found set that is that is hanging me up. I even tried exporting to an external table - then importing but it just seemed too dopey. C
August 18, 200817 yr Your found set is based on the PI_ProspectItems_TOG; your import Source is “file:Hanover_Strings” but we can't tell from that what TO in that import source is being referenced.
Create an account or sign in to comment