+ Start a Discussion

Adding object in a cart

I have 2 object:
Products and Cart. The objects have the same fields.
I want to copy after a click (in a commandlink in my products vfp) a product from the Object products in a Cart object.
How i can write the code?
Luis Antonio Aguilar RosalesLuis Antonio Aguilar Rosales
Your question is not clear, but If you want to have a functionallity to add products to a shopping cart you can create a juntion object to relatate the products with the cart, cause one product can be in many carts and one cart can have many products, so you need a many to many relationship.
So when you click on the product ( will be better a command button but it depends of the bussines rules ), you will create a relationship in the juntion object, and in this juntion object you can add a quantity field to specify how many products you want to add to your cart