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.
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.
- Get the customer id by customer name.
- Add a record to the Order list.
- 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