locked
Save and next item SharePoint edit form RRS feed

  • Question

  • Hello,

    I've made some custom forms in which I want an option save and next, is this possible?

    Regards, Remco

    Friday, April 20, 2012 1:51 PM

Answers

  • I suppose, it should be as easy as checking that the next ItemId exists then retrieving the item data.

    EmpowerIT (Australia) for all your CRM/SharePoint needs. http://mscrmblog.net
    Microsoft Certified Business Management Solutions Specialist
    Microsoft Certified CRM Developer

    • Marked as answer by Remco Hooijer Thursday, April 26, 2012 9:37 AM
    Sunday, April 22, 2012 9:49 PM
  • Looks promising. I know how to make a link to a form with the @id option. How do make this so that is goes to @nextid?

    • Marked as answer by Remco Hooijer Thursday, April 26, 2012 9:37 AM
    Tuesday, April 24, 2012 7:48 AM
  • assuming your ID is an int,use:

    var nextId = itemId++;

    SPListItem nextItem = list.GetItemById(nextId);

    if (nextItem != null)

    { //do your magic here.}


    EmpowerIT (Australia) for all your CRM/SharePoint needs. http://mscrmblog.net
    Microsoft Certified Business Management Solutions Specialist
    Microsoft Certified CRM Developer

    • Proposed as answer by Ibrahim Sukari Thursday, April 26, 2012 1:53 AM
    • Marked as answer by Remco Hooijer Thursday, April 26, 2012 9:37 AM
    Thursday, April 26, 2012 1:53 AM

All replies

  • Hi Remco,

    The short answer is that yes, that should be possible. You can probably either create a data form web part or develop it from scratch.

    Have you tried the datasheet view from the browser? That allows editing multiple records at once.


    Pman
    http://www.pmansLab.com/

    Saturday, April 21, 2012 1:04 AM
  • I suppose, it should be as easy as checking that the next ItemId exists then retrieving the item data.

    EmpowerIT (Australia) for all your CRM/SharePoint needs. http://mscrmblog.net
    Microsoft Certified Business Management Solutions Specialist
    Microsoft Certified CRM Developer

    • Marked as answer by Remco Hooijer Thursday, April 26, 2012 9:37 AM
    Sunday, April 22, 2012 9:49 PM
  • Looks promising. I know how to make a link to a form with the @id option. How do make this so that is goes to @nextid?

    • Marked as answer by Remco Hooijer Thursday, April 26, 2012 9:37 AM
    Tuesday, April 24, 2012 7:48 AM
  • assuming your ID is an int,use:

    var nextId = itemId++;

    SPListItem nextItem = list.GetItemById(nextId);

    if (nextItem != null)

    { //do your magic here.}


    EmpowerIT (Australia) for all your CRM/SharePoint needs. http://mscrmblog.net
    Microsoft Certified Business Management Solutions Specialist
    Microsoft Certified CRM Developer

    • Proposed as answer by Ibrahim Sukari Thursday, April 26, 2012 1:53 AM
    • Marked as answer by Remco Hooijer Thursday, April 26, 2012 9:37 AM
    Thursday, April 26, 2012 1:53 AM
  • Ibrahim,

    I don't think that would work because "itemId++" will give you the next supposed ID for sure, but that doesn't mean it's valid. What if that record with that ID was deleted? You could potentially have 5 records in a list whose IDs could be "1, 3, 8, 9, 15". This could happen if the records with ID 2, 4, 5, 6, 7, 10, 11, 12, 13 and 14 were deleted.

    My understanding is that SharePoint will continue creating ID from the "Last Item" that was created. Is that not right?


    Pman
    http://www.pmansLab.com/

    Friday, April 27, 2012 12:34 AM