Skip to main content

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?

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


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


Reply