locked
Add/subtract a Quantity in one list from another list RRS feed

  • Question

  • Hi there,

    I don't want to move fields/duplicate them.

    I want to know how you can add/subtract a quantity in one list from a quantity in another list?

    Can anyone please help?

    Kind Regards,

    Marli

    Thursday, November 22, 2012 10:32 AM

All replies

  • You need to add a data connection to the other list into the form, once done you can use the sum function against a control to asses the value of a field in the other list you added through the data connection against a value of a field in your form.

    Sergio Giusti

    Thursday, November 22, 2012 1:13 PM
  • Hi there,

    Thank you,

    Do I do this in SharePoint itself or in the Designer?

    I will find out how to do this,

    Thanks,

    Regards,

    Marli

    Friday, November 23, 2012 6:33 AM
  • Hi,

    When you talking about quantity, do you mean by add or subtract the number of items in one list(let’s call it list1 here) based on the item count in another list(list2 here)?

    If so, you can use a SharePoint designer workflow to increase the items: Add a workflow in list2, set the workflow to start when an item is created. Use the workflow to create an item in list1. In this way, the items in list1 will increase based on items in list2. But when it comes to detract, you need to create event handler. Because the designer workflow cannot watch the item deleted event.

    If I have any misunderstanding ,please feel free to point it out.

    For more information about create an itemdeleted event handler, please refer to this site:

    Example: Creating a List Item Event Handler: http://msdn.microsoft.com/en-us/library/ms437502(v=office.14).aspx

    Thanks,

    Entan Ming


    Entan Ming
    TechNet Community Support

    Friday, November 23, 2012 8:22 AM
  • hi you can do it either way.  you could ue infopath to customise the form from the 2nd list and add a data connection into that to do the calculations or you could use sharepoiint dsigner and make a workflow and set the action to be 'Do Calculation' and then map the connection into the action to so the sum.

    Sergio Giusti

    Friday, November 23, 2012 9:04 AM
  • Hi there,

    Thank you both, I want to add/subtract a quantity in one list from another.

    Thanks for all the info.

    Kind Regards,

    Marli

    Friday, November 23, 2012 9:12 AM
  • Hi,

    The only problem I have with Infopath is that when I publish the form it changes the look and feel of the form - it then looks like a grid, not a form anymore.  Is this right?

    Kind Regards,

    Marli

    Friday, November 23, 2012 11:54 AM
  • Hi,

    What kind of customization you have made to the form? Can you share a screenshot of your grid like form? Do you added the lines or it just appears after you publish the form?

    Thanks,

    Entan Ming


    Entan Ming
    TechNet Community Support

    Monday, November 26, 2012 10:19 AM
  • Hi Entan,

    It just appears after I publish the form.  I recreated the list as I didn't know how to fix this.  Wil quickly reproduce this for a screen shot.

    Kind Regards,

    Marli

    Monday, November 26, 2012 12:50 PM