Importing Data - Primary Key Linking

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
ACDC
Posts: 1143
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Importing Data - Primary Key Linking

Post by ACDC »

Hi

I wish to import data into a Product Object and want the ProductCode to be the Primary Key. How do I enforce this rule. At the moment I understand the ID is the Primary Key and it is system generated.

In my case the ProductFile comes from an outside application CSV file and is imported on a daily or weekly basis. Ideally I would like to make the ProductCode the Primary key.

The CSV file contains the same ProductCodes on every import, but may have minor changes to it (like price change) or new codes.If the ProductCode is tied to the Primary key, then the product code will overwrite existing codes with any changes incurred since the previous import.

Can anyone help me here with a rule that can make My ProductCode attribute behave as if it were the Primary key or some way to achieve the above

Thank You
ACDC
Posts: 1143
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Post by ACDC »

Hi
I managed to resolve this. If all else fails read the manual!

To do this, one has to insert a * in the name of one of the column headers you want to link before proceeding with the import. eg *Customer.Customer.Code. This will tie the customer code in as a primary key for the import. --Absolutely Brilliant.

However, one problem I am experiencing when doing this is, if there are new items in the list, they are rejected from the import. According to the manual they should be added.

Could support please clarify if the Import function should add the record if it does not exist.

Thank You
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

ACDC,

Do the logs give you any clues for the rejection?

Tom
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

You have to separate records to insert from records to update in two different files.
Aware IM Support Team
ACDC
Posts: 1143
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Post by ACDC »

It would be a really good feature to have adding and updating happening in one import because that reduces manual work needed to split the file.

In my case I have a product file with 1000's of product codes with prices changing periodically. It would be a really big job to strip the newly added product codes because I have no control over the remote system.

Maybe it would be an Idea for the Import process to create a log file with the rejected items, so this can be re - imported as a separate file afterwards.

Please add to wish list
Thank You
Post Reply