StrataFrame Forum

BO and EDI Translated file

http://forum.strataframe.net/Topic17032.aspx

By Guillermo Vilas - 6/13/2008

Hello,
I´m working with a project that needs to read EDI (Electronic Data Interchange) to process orders. I have the fixed length plain txt which I process using FileHelpers class (I fully recommend http://www.filehelpers.com ) and created the correspondig table and BO to do the CRUD work for me. The problem I´m having is that the table does not have a primary key at all. And the BO is throwing exception when I try to save the items stating that there´s no primary key.

I already tried setting the BO with the PrimaryKeyIsAutoIncremented to false and AutoUpdatable to true, same result and the only way I´ve fund the get this to work is adding a new field to hold a primary key.

So my question whould be that if I can use BOs with tables that has no primary keys at all?

I will apreciate any help or suggestion to deal with this scenario

By Edhy Rijo - 6/13/2008

Hi Guillermo,

In the Business Object Mapper (BOM) select the BO and then select Property, there you will see an option to Override Primary Key Specification, check it and then click the ... button to select the fields you want to use as your Primary Key. 

That should do it for you.

By Guillermo Vilas - 6/16/2008

Thanks Edhy

I completed forgot about the Overrides Primary Key Specification. Hehe
By Trent L. Taylor - 6/16/2008

Perfect!  Thanks, Edhy Smile
By Edhy Rijo - 6/16/2008

Your are welcome guys!