Hi Ashish,

I don't like too much the idea of adding behind the lines the role to the party: in fact, if the user selects a wrong partyId (for example a supplier) and the system will make it a customer... The best solution would be, IMO, to enhance the UI (maybe with some Ajax magic) so that, when the user selects a role, then only the parties with that role are shown.

Jacopo

On Jul 18, 2008, at 9:59 AM, Ashish Vijaywargiya wrote:

Jacopo,

I remembered that somewhere in Ofbiz a functionality exists to first check the associated role based record, if it doesn't exists then first it creates
that record and then
create the Record in the calling entity that check for foreign key
constraint.
I think we should avoid this kind of error as far as User Point of View is
concerned.

Does this scenario applies to here as well ?
If yes please let me know I will work on it as soon as I will get a chance.

Please let me know your thoughts on this.

On Thu, Jul 17, 2008 at 6:02 PM, Jacopo Cappellato <
[EMAIL PROTECTED]> wrote:

You should add to the party 10000 the role of CUSTOMER to avoid that error.

Jacopo


On Jul 17, 2008, at 2:28 PM, Amine Benkirane wrote:


   Hi,

I'm customizing, acutally, an OFBiz ecommerce site. For my specific needs, I want to associates Categories and products with parties. Basically, I add a party like customerA (partyId = 10000) and I want that this customer can only visualize (and buy) the categories and products which are associated to
him.

I saw that in the Catalog Manager Application when I browsed my categories and click on one, there is a parties menu. I thought that can do my need but when I want to associate party to category (I select customer for the type),
I had this error :


The Following Errors Occurred:
     ERROR:
Could not complete the Add Party to Category

[file:/C:/Projets_Eclipse/ofbiz-mars/applications/product/script/ org/ofbiz/product/category/CategoryServices.xml#addPartyToCategory] process [problem creating the newEntity value: Error while inserting:
[GenericEntity:ProductCategoryRole][createdStamp,2008-07-17
14:25:46.005(java.sql.Timestamp)][createdTxStamp,2008-07-17
14:25:44.453(java.sql.Timestamp)][fromDate,2008-07-17
14:25:46.005(java.sql.Timestamp)][lastUpdatedStamp,2008-07-17
14:25:46.005(java.sql.Timestamp)][lastUpdatedTxStamp,2008-07-17

14:25:44.453(java.sql.Timestamp)][partyId,10000(java.lang.String)] [productCategoryId,snackfood_fr(java.lang.String)] [roleTypeId,CUSTOMER(java.lang.String)]
(SQL Exception while executing the following:INSERT INTO
OFBIZ.PRODUCT_CATEGORY_ROLE (PRODUCT_CATEGORY_ID, PARTY_ID,
ROLE_TYPE_ID, FROM_DATE, THRU_DATE, COMMENTS, LAST_UPDATED_STAMP,
LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (INSERT on table 'PRODUCT_CATEGORY_ROLE' caused
a violation of foreign key constraint 'PROD_CRLE_PTYRLE' for key
(10000,CUSTOMER). The statement has been rolled back.))]

Did I forgot something to do this association betwwen my categories and
parties ?

Regards,

Amine




_________________________________________________________________
Votre correspondant a choisi Hotmail, un e-mail ultra sécurisé. Créez le
votre gratuitement !
http://www.windowslive.fr/hotmail/default.asp





--
Ashish Vijaywargiya
Indore, India
http://en.wikipedia.org/wiki/Indore

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to