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. – MJVM Aug 26 '14 at 6:21

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

  • 1-No maybe my customer have same names I want to track only by ID. 2- Please if you could give me a sample example because I am new to SharePoint development. – MJVM Aug 26 '14 at 6:26
  • Here is for adding item. msdn.microsoft.com/en-us/library/office/… and here is for reading items msdn.microsoft.com/en-us/library/office/…. Those are the wto operations you will need. – Malin De Silva Aug 26 '14 at 6:30
  • If you could answer my question practically in some blogs according to my problem. – MJVM Aug 26 '14 at 7:17
  • So do you want me to write the whole code for you? – Malin De Silva Aug 26 '14 at 7:24
  • If you can help me because I am new to SharePoint Development – MJVM Aug 26 '14 at 7:36

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.