Prompt next file number

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
jcmeyer
Posts: 4
Joined: Mon Jul 07, 2014

27 Apr 2015

Hello,



my sharePoint list has 4 content types. My client has requested that each content type has a custom File Numbering system. the system is as follows



GD-yy-nnn

e.g. the letters GD, follows by 2 digit year, then 3 digit serial number. The first record in 2015 is GD-15-001

The other 3 contet types are

LR-yy-nnn

PL-yy-nnn

RP-yy-nnn


Is there a way to prompt the user for the next number when they go to input a new record using Forms Designer? It can be a simple solution.


I was thinking to simply query the most recent date created for the current content type, then alerting the user to the File Number of the most recent file. This alert could pop up on form load, or the alert could pop up after clicking a button in the form. We have column "fileNumber" in our list, in addition to the default SharePoint "created" column.

The alert could simply read: "The last number used for this content type is: ___" That would give the user an idea of what File Number to use on the current item.

Any ideas how to implement this?

thank you very much

PS: a more advanced solution would be to actually recommend the corrent number, and include that as the default value in File Number field, but this level of automation is not required for our purpose. Thank you.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

28 Apr 2015

Hi,

You can request the latest item of the same content type directly from the form via CSOM or REST api by sorting items by ID in descending order and getting a top item. Next, increment the File Number field of the retrieved item and insert the result into the form field with the help of our JS-framework.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 25 guests