Skip to main content
A current customer wants the functionality within SmartForms to open a instance, do nothing and release it back to being unallocated. Current K2 functionality sets the user's slot to open and all others to allocated. Customer needs to be able to release this instance in some form as users may have opened the instance and be no longer available (holiday, sickness, etc). Currently, this reallocation can only be done by a administrator in the management console or the workspace, I believe.

Is there a common solution that we can implement here to satisfy the customer's wishes?
The openworklistitem method in the K2ROM does have a parameter that will allow you to open an item but not allocate it. This would perform the functionality that you want however because smartforms do not expose this property there is no way that I know to tell the smartform to do this.

If anybody else has had any luck with this please chime in but I have not found a way.

Also the user that opens the item can release that item back to the group through the workspace interface. They do not have to be an administrator to do this. (Right click on the item and select release) The only potential problem with this is that the user would have to remember to do it.

My suggestion would be to not use the smartforms and instead use regular aspx pages with K2ROM code behind them. That way you could have the item be opened but not allocated. Here is the description of that functionality from the help files:

Open a Worklist Item based on the Serial number, Platform and Allocated status. If the Alloc parameter is set to True, K2.net 2003 Server will allocate the worklist item to the logged on user making the item unavailable to the other destination users, setting the parameter to False allows you to view the Item without allocating it to the User.
[Visual Basic] Overloads Public Function OpenWorklistItem(String,String,Boolean) As WorklistItem

[C#] public WorklistItem OpenWorklistItem(string,string,bool);

[JScript] public function OpenWorklistItem(String,String,boolean) : WorklistItem
You can prevent Smartforms from allocating a slot when it is opened. To do this, you can add the parameter to the client event URL in K2 Studio. In this case you need to add Allocate=false , so the whole URL would be something like this:
http://localhost/Test1/ApproveDoc.aspx?sn={SERIALNO}&Allocate=false


Now the problem I see here is, the Smartform will not allow you to submit the form if you have not allocated the Worklist item, any Finish and Update buttons are disabled. So in this case a possible workaround would be to have a standard ASP button that asks the user if they actually want to work on this item and redirects to the same page except changing the Allocate parameter to be false (which will enable the submit button).

This again relies on the user s cooperation to actually finish the item after they ve allocated it to themselves, which may bring you back to square 1, unless you add some extra code on your page to work around it (something like using session state to populate the page again but using the URL without setting Allocate to false after the user clicked the standard ASP button and submitting the data automatically).

So, even though this is still possible using Smartforms, I have to agree with Eric, using K2ROM would be easier.

Reply