How can I set up the custom Folio?

  • 30 November 2005
  • 8 replies
  • 0 views

Badge +7
Hi,

I've made a default process with a Folio - Document Approval.
On start page a user enters number of the contract and it comes to K2.Net field "ContractNum".
Is it possible to set the Folio as a concatenation of these two strings, in order the user is able to see something like "Contract Approval - XX122/1005" in his Workspace and K2.Net SharePoint Webparts (tasks and history).
Unfortunately I'm unable to find where I can set the Folio in K2.Net Studio.

Regards,
Andrei

8 replies

Badge +9
In K2.net Studio add a server event and add the following code to the server event assuming you want to concatenate DataField1 and DataField2

K2.ProcessInstance.Folio = K2.ProcessInstance.DataFields("DataField1").value & " - " & K2.ProcessInstance.DataFields("DataField2").value
Badge +11
Sure you can do this. Have a look at the sample code under the Connection class of the K2ROM object model in the help file.

Regards,
Ockert
Badge +7
Thank you very much! I missed this...
Badge +1
Hi,

The same code is not working in C #.

K2.ProcessInstance.DataFields("DataField1") is Not available in C#. Can some give me the work around please ! :roll:
Badge +11
Try the following:
K2.ProcessInstance.Folio = K2.ProcessInstance.DataFields["Datafield1"].Value;

Just a comment...
If you're not completely comfortable with C#, VB.net is much more forgiving.

Regards,
Ockert
Badge +7
Hi,

simple question.
I an Infopath process do I have to use an Infopath Server Event if I want to set up my own custom folio or can I just use an Default Server event or better where is the difference you I think it should work with Default Server event, right ?
Badge
icon-quote.gifwebber77:
Hi,

I've made a default process with a Folio - Document Approval.
On start page a user enters number of the contract and it comes to K2.Net field "ContractNum".
Is it possible to set the Folio as a concatenation of these two strings, in order the user is able to see something like "Contract Approval - XX122/1005" in his Workspace and K2.Net SharePoint Webparts (tasks and history).
Unfortunately I'm unable to find where I can set the Folio in K2.Net Studio.

Regards,
Andrei


If you are using K2.net a SmartForm for your plan (start) page, the easiest way to set the Folio is to set the DataField Property of the PlanButton to the Folio field. Then in the PlanButton's Click event you set the DataValue to whatever you like...

private void button1_Click(object sender, System.EventArgs e)
{
// Assuming that your Contract Number is being entered in a TextBox
// named txtContractNum
button1.DataValue = "Contract Approval - " + txtContractNum.Text;
}

Regards,
Mike
Badge +7
Thanks Mike,
Nice solution :)

Reply