Page 1 of 1

Import Price Loader Format Setup - 10 pg pdf

PostPosted: Fri Aug 06, 2004 7:41 pm
by red1
Here please find a 10 page PDF document describing howto create and setup a new format loader. This Import Price example was done in the midst of implementing Compiere as described in the Workshop Case Study. Download it from http://compiere.red1.org/ImportPriceSetup.zip

Import other files

PostPosted: Wed May 18, 2005 1:05 am
by primer
I tried your Import Price Loader and wow, it's easy to follow. I then tried to create my own Import for Bill of Material, but I had an error at the final step of bringing it from I_BOM into the BOM table.

According to my friend, it was due to using an UPDATE command instead of INSERT command... (?) Any ideas?

thanks

PostPosted: Wed May 18, 2005 7:12 am
by red1
Hi Primer,
This is an Open Source Experience portal i m creating here ;) . So u would have to paste the codes and relevant parts here so that ppl can see what is happening.

Thanks for joining and making IT happen. :lol:

cheers
red1

PostPosted: Wed May 18, 2005 12:08 pm
by primer
Hi Red1,

Sorry about it! :wink: This is the code I am doing to import the BOM into M_Product_BOM. I have completed all the previous steps and already import into the table ImportBOM. This is the last step on how to get it into M_PRODUCT_BOM. Below is the script.

Insert into M_PRODUCT_BOM (AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, LINE, M_PRODUCT_ID, M_PRODUCTBOM_ID, BOMQTY, DESCRIPTION, BOMTYPE)
select AD_CLIENT_ID,AD_ORG_ID,'Y',UPDATED,CREATEDBY,UPDATED,UPDATEDBY,LINE,'','',QTY,' ',BOMTYPE from ImportBOM

After running this script, there is an error message that "cannot insert null value into M_PRODUCT_BOM_ID. I realised that this ID is auto generated. In this case, how do I insert new records into the M_Product_BOM table? Same case for the import of price, as the coding you gave was to update rather than insert.

Thanks! Appreciate your help!

PostPosted: Wed May 18, 2005 4:36 pm
by new_soft
Hi Red1,
It seems that the archive is not a valid one, i have the error when i try to unzip it with winrar or winzip.

PostPosted: Tue Jun 14, 2005 4:12 am
by trifon
primer wrote:Insert into M_PRODUCT_BOM (AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, LINE, M_PRODUCT_ID, M_PRODUCTBOM_ID, BOMQTY, DESCRIPTION, BOMTYPE)
select AD_CLIENT_ID,AD_ORG_ID,'Y',UPDATED,CREATEDBY,UPDATED,UPDATEDBY,LINE,'','',QTY,' ',BOMTYPE from ImportBOM


Hi,
You must modify insert statement to look like this:
insert into M_PRODUCT_BOM (AD_Sequence_NextNo('M_PRODUCT_BOM'), ...
AD_Sequence_NextNo('M_PRODUCT_BOM') will generate unique primary key for table M_PRODUCT_BOM.

Regards,
Trifon