0

I have three table Customer, Product and Orders I want to insert data of my customer when he orders a product means ones my customer data is inserted in customer table his ID should be taken and inserted to orders table with product Id I am new to SharePoint development if any one could help me with a detailed example.

  • 3 tables mean 3 lists? – Malin De Silva Aug 26 '14 at 6:02
  • No I don't want to insert multiple records at once, what I want is when I created my customer how can I get the Id of my customer and insert it in Orders table with other order details. – Mehdi Jalal Aug 26 '14 at 6:21
0

I am assuming the product name of the Product list and customer name of Customer list are unique. Then what you need to do is select a customer and then select multiple products and place the order.

Here you better keep 2 lists to handle orders. one is for order meta data and the other is for product items and each items quantities in the child table. the Order Item list will have a lookup columns to the Order list and the Product list and the Order list need to have a lookup to the Customer list.

  1. Get the customer id by customer name.
  2. Add a record to the Order list.
  3. Loop through all the products in the currently placing order.

3.1 Get the product id of the current product by name and add list item to the Order Items list

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.