SachinSant
Novice

Need Help on Autonumbering

Jump to solution

Hello,

 

I am new to K2 and developing basic applications. One of the application requires to generate Autonumber when user clicks on Save button.

 

I am seeking help on following queries.

 

1)  How to retrieve max(id) from SharePoint list in K2? I knew in Infopath we can do it very easily.

2) How to do aunumbering to newly added items in SharePoint list?

0 Kudos
Reply
2 Replies
BryanPeters
Apprentice

Re: Need Help on Autonumbering

Jump to solution

SachinSant,

 There are a few ways you could probably do this. If you do not want to use the ID you can create a column in the SharePoint list. The in K2 Designer you can edit the SmartObject and set the field to autonumber. You may have to start with a number to make this work.

 

Another way you might do this is to create a calculated column in the SharePoint list called SP_ID. The calculated column takes the last ID+1. 

 

You can also create a rule in K2 Designer on initialize to read the SmartObject and pull the last ID into a parameter. Then use an expression to take that parameter and add a number to it and save it into a field within your form.

 

There are a few outside the box ideas that might work. I hope this helps.

 

Thanks,

Bryan Peters

0 Kudos
Reply
SachinSant
Novice

Re: Need Help on Autonumbering

Jump to solution

Hello Bryan,

 

Yes I have achieved Autonumbering using following steps..

 

1. Use Smartobject Get List method to retrieve last id.

2. Use Expression to increment last id by 1 as new id

3. Store new id as Request No.

 

This works fine.

 

Thanks for your response.

 

Sachin

0 Kudos
Reply