SmartForms from K2 are here!

clock September 29, 2011 09:46 by author steveboldt

K2 has just announced their much anticipated release of the next generation of form technology. It allows for the development of forms in a totally browser based environment. For any of you that have struggled in the area of integrating InfoPath forms and other form technology into SharePoint or other applications, you will find a whole new easy-to-use experience with SmartForms.

K2 Smart Forms are built upon the K2 SmartObject technology. What this means is that you will be able to integrate with many different types of data sources. One of the features that I love is the reusability of existing modules (building blocks) within the forms to be able be used across multiple applications.  The whole interface is very user-friendly with a drag and drop interface that is easily customizable.

Integration with SharePoint is seamless and easy. Not requiring all theses “tricks” to get the form published and up and running to the user.

To find out more information about K2 SmartForms, go to K2’s website : Find out more about K2 SmartForms here

I’ll be publishing more content about SmartForms in the near future…..

Currently rated 3.0 by 25 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


How to get (force) the Windows Mango Update on the Samsung Focus 7 (1.3)

clock September 28, 2011 17:01 by author steveboldt

In order to get the Mango update pushed to your Windows Phone 7 on the Samsung Focus (1.3), you will actually need to "pull" it.

Follow these steps to show the update in the Zune software:

  • Plug your Samsung Focus into your computer and wait for the Zune’s software to load up.
  • After the software loads, go to settings, and click on update. As soon as you do this, DISABLE your wireless connection on your laptop (or disconnect your cable). When you disable the internet access, it will notify you that there is a new update for your phone. At this point, re-enable your wireless connection or cable.

Win7mango1

  • The next screen will appear showing there is a Windows update available. Proceed with this update in it’s entirety.

Win7mango2

  • It will go through the entire update process. When it’s completed, it will tell you that your phone has been successfully updated.
  • Repeat the process of going to update and disabling your wireless connection again to force a new update. When you see that there is a new update, it will tell you that you will need to update your Zune software
Win7mango3 Win7mango4 Win7mango5 Win7mango6

 

  • After Zune restarts, you will need to, yet again, follow the above procedure of “forcing” the update. It will then show you there is a new update, this time it’s labeled 7.0.7403.0

Win7mango7

  • Follow the upgrade installation again all the way through. After you complete one update, you will notice it will run an additional update, as needed.
  • Win7mango8 Win7mango9

 

  • If you notice in the last screenshot, the version upgrade is marked as 7.10.7720.68, this is the Windows Mango update version.
  • Congrats! You’ve successfully installed the updated version of Windows Phone! Enjoy the Mango experience.

(note, this may not work everyone, but this is the steps I took to get my update working correctly when I wasn’t seeing an update come across)

Currently rated 4.0 by 21 people

  • Currently 3.952381/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Accessing K2 API via K2 reference event

clock September 1, 2010 17:22 by author steveboldt

There is a way to access the K2 API from the reference event, although I will make the disclaimer that this is not supported in blackpoint. I will go over the steps of calling the GoToActivity method of the API from a reference event within the K2 designer.

Within K2 designer, you will need to drag a reference event onto the workspace. k2referenceevent

 

Configure an event name for the event, and after clicking next, you will come to a screen within the wizard to add a Constructor.

k2referenceevent_addevent

The next wizard you will want to click the "Add Reference” button and browse to “C:\Program Files (x86)\K2 blackpearl\Bin\SourceCode.Workflow.Management.dll” (if using a 64bit server). Select this DLL and add it to the list of available managed process references.

k2referenceevent_addref Click finish and then on the wizard where you select the constructor, expand the nodes as follows:

SourceCode.Workflow.Management
– SourceCode.Workflow.Management 
     – WorkflowManagementServer 

select Constructor(String host, UInt32 port).
k2referenceevent_addeventwms

 

For the configuration properties of the constructor, enter the following:

host: value is the server name of K2
port: value is the port that the K2 server is running on (typically 5555)
k2referenceevent_addeventwms_b

 

Once this constructor has been added, you will be brought back to the main wizard screen for the reference event and now it will allow you to add a Method event.

k2referenceevent_addmethodevent

After you click the add method option, you will need to expand the WorkflowManagementServer node and scroll down and find the method Open()

 

k2referenceevent_open Select Next and leave the default values for the configure properties and click Finish

 

 

 

Once more on the reference event main screen, click Add Method and expand out WorkflowManagementServer and find the method GoToActivity(Int32 procInstID, String activityName) : Boolean

k2referenceevent_goto

After clicking next, you will need to configure the method. The only values you need to worry about populating are the procInstID and activityName.

procInstID – identifies the K2 process ID that you want to perform the GoToActivity method request. This values can be accessed many different ways. For my example, I stored the K2 process ID of my workflow in a SharePoint list and I called this workflow on the update of the list item (using the SharePoint event integration process within K2) and stored the ID in a data field.

activityName – this field refers to the Activity in question that you want to “Go To”. If you reference the correct process ID, you can call an activity in any K2 process as long as you have the activity name correct.

Click Next after configuring these 2 values, leave the connection properties as default (empty) and click Finish
k2referenceevent_gotoconfigure

 

k2referenceevent_finish

At this point, you are done configuring your Reference event and it should look like the screenshot to the left. Click Finish and you are done with the reference to the K2 API. Build and Deploy your process and test it out.

Currently rated 3.2 by 11 people

  • Currently 3.181818/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


BizTalk Help Tips (Enlisting exception error)

clock April 14, 2010 11:32 by author steveboldt

Here’s a helpful hint, in case you run into a problem trying to enlist an orchestration. If you run into an error while enlisting an orchestration after deploying it to the server, you might want to consider if you followed the proper steps to deploy the orchestration. Common knowledge is to ensure that the proper assembly is available in the GAC upon the server you deployed the BizTalk orchestration to. In addition, make sure all the assemblies that the BizTalk assembly uses are also available in the GAC as well.

If this isn’t the case, you could run into the following exception:

Exception type: BTXEnlistmentException

“NullReferenceException exception occurred while the XLANG/s runtime enlisted a service.”

Just make sure you include a script to GAC the DLL into the assembly and you will be able to proceed.

Currently rated 2.8 by 11 people

  • Currently 2.818182/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Populating a repeating table in InfoPath programmatically

clock March 2, 2010 19:14 by author steveboldt

There are times when you connect to a secondary data source in InfoPath and would like to automatically populate a repeating table based off the source. This can be done whether it is through a database or SharePoint data connection.

First step would be to create a secondary data connection in InfoPath. Once you have done this, drag a repeating table onto your page. For my example, I placed the code in the loading event of the form.

The first section of code you need to set an XPathNodeIterator to specify the secondary data source that needs to be pulled from.  In addition, the actual node where the repeating group resides needs to be specified. (See line 2)

Once the node iterator is set, then the loop of code that will set all the fields of the actual repeating table. An XML document needs to be created to store the values and then after all the elements are populated, it will be appended to the repeating table row and then looped through again as many times as there is data that exists in the data source. The first part of the xml document is called the group and that references the repeating table. The xml nodes marked field reference the repeating table fields. The InnerText needs to be set of the field nodes and this is obtained by the navigator created in the foreach loop. The field in that navigator is obtained from the secondary data source. (See lines 6-19)

After setting all the nodes with the proper values, the repeating table needs to be appended with the xml document. The group that hold the repeating table is referenced and the xml document is appended. (See line 22)

Final step is to remove the empty row in the repeating table. Create a navigator that references the FIRST item index of the repeating table and then call the DeleteSelf() method. (See lines 25-26)

   1: //select the secondary data source
   2: XPathNodeIterator xDomNodes = this.DataSources["DataSourceName"].CreateNavigator().Select("/dfs:myFields/dfs:dataFields/d:TableName", this.NamespaceManager);
   3:  
   4: foreach (XPathNavigator xDom in xDomNodes)
   5: {
   6:        XmlDocument doc = new XmlDocument();
   7:  
   8:        //set first field(column)
   9:        XmlNode group = doc.CreateElement("RepeatingTable", NamespaceManager.LookupNamespace("my"));
  10:        XmlNode field = doc.CreateElement("RPField1", NamespaceManager.LookupNamespace("my"));
  11:        XmlNode node = group.AppendChild(field);
  12:        node.InnerText = xDom.SelectSingleNode("@Field1", NamespaceManager).Value;
  13:  
  14:        //set second field(column)
  15:        field = doc.CreateElement("RPField2", NamespaceManager.LookupNamespace("my"));
  16:        node = group.AppendChild(field);
  17:        node.InnerText = xDom.SelectSingleNode("@Field2", NamespaceManager).Value;
  18:  
  19:        doc.AppendChild(group);
  20:  
  21:        //populate repeating table with xml of database values
  22:        MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:mRepeatingTableGroup", this.NamespaceManager).AppendChild(doc.DocumentElement.CreateNavigator());
  23: }
  24: //remove empty row
  25: XPathNavigator firstNode = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:RepeatingTableGroup/my:RepeatingTable[1]", NamespaceManager);
  26: firstNode.DeleteSelf();

Currently rated 3.1 by 26 people

  • Currently 3.115385/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


K2 Tips & Tricks #2 – Using the InfoPath toolbar Submit button as a task action

clock November 19, 2009 11:29 by author steveboldt

Sometimes, when using K2 blackpoint or K2 blackpearl, you encounter InfoPath forms that you only have one choice in the workflow. For example, you have an InfoPath form that the originator fills out and submits to IT. Then, IT fills out the required information and submits the form to accounting. No decision is made, just filling out the information needed and submitting the form. With the InfoPath client event, you need to specify a task action field to direct the outcome of the process. Usually, the client event wants you to bind to a drop down, but if you already know the outcome, this isn’t necessary.

The solution:

Open up the InfoPath form in design mode from K2. Add a new field to the data source of data type string (ie. TaskActionSubmit). Set the Default value to Submit. Save the form and close it. Once K2 has let you know the form template has been updated, go to your InfoPath client event and below in the Task Action field, select the field you just created.

When you click Next, a popup will ask you if you want to change the drop down configuration. Select NO.

 bind_dropdown

Click Next through the wizard until the Actions screen. Add an action called Submit (the same value you put in the default value field for the node you created in the data source of the InfoPath form). Check the box for generating a line for outcomes. Do the same for the outcomes screen. Then click Finish.

At this point, when you run the form, when the user clicks the submit button of the form, it will use the action field that you bound to direct the workflow.

Currently rated 3.2 by 22 people

  • Currently 3.181818/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


K2 Tips & Tricks #1 – Displaying the correct InfoPath view in the client event

clock November 18, 2009 16:10 by author steveboldt

From my own personal experience and hearing the frustration of others, there are some times when integrating an InfoPath form that it won’t display the correct view on certain activities. Usually, this is a random occurrence and will result in the form displaying the default view instead of the desired one.

Well, now, this problem can be resolved with a very easy fix! More then likely, at one point in the process, you were creating views, and either created, renamed or deleted a view. As a result of this, entries should be either modified in the manifest.xsf of the Form template. However, for some reason, this doesn’t always occur and will cause inconsistencies.

If you are experiencing the problem of the correct view not displaying, more then likely a RULE is not configured properly in the open behavior of the form. To verify this, you can go to the form option and select the Open and Save category from the options and select the Rules button in the Open behavior section. This will give you a list of rules that will fire upon opening of the form. K2 sets these rules based upon your configuring of the InfoPath client event in each activity.  While you have these rules open, copy the template file from the K2 InfoPath Form Template folder and rename it with a .cab extensions. This way, you can extract out the manifest.xsf file locally.  Search for the ruleSet section named "ruleSet_OnLoad” and you will more then likely see a discrepency between the rules displaying in the form options and the ones in the manifest.xsf.

The Fix (K2 blackpearl or K2 blackpoint)

Here are the steps you need to take to resolve the problem:

  • Open up the InfoPath Integration process wizard in either K2 blackpearl or blackpoint
  • Click on the Design button
  • When the form loads, go to Tools/Form Options select the category Open and Save
  • Click the Rules button under the Open behavior section
  • Select one of the rules and select “Modify”.
  • Click OK
  • Click OK again until you are out of the Form Options
  • Save the form
  • Close the form
  • K2 will tell you the form template has been successfully been updated

What this does is resets the rules for the form options and cleans out the ones that are empty in the manifest. (I actually added an generic rule and then went back and deleted it and this also force the form to refresh).

At this point, you can go back to the InfoPath client events and associate the event with the correct view and finish the wizards. If you go back and open the form, it should have the new rules associated with the views that you just associated with in the wizard.

Deploy the process as usual.

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Cloning a K2 workflow process from InfoPath

clock October 7, 2009 17:41 by author steveboldt

I encountered a situation at a client that had a requirement for cloning an InfoPath form by the click of a button. They wanted the ability to kick off a new work item and retain part of the forms information. The reason being that they might fill out anywhere from 1 – 200 form with some of the information always remaining the same for that particular instance. One thing to note, the InfoPath form was browser-enabled. I was able to design a solution using code-behind on the button click event on the form.

Blank Slate

As I mentioned earlier, one of the requirements was to retain a “portion” of the form. In order to do so, I needed to get a blank copy of the form’s XML structure before it’s loaded. I obtained this by adding code to the FormEvents_Loading method of the InfoPath form. Additionally, I was working with a large portion of views, so I needed to make sure I retained the XML throughout the process and also that it was not overwritten. To achieve this, I added the following nodes to the InfoPath form’s data source:

  • Name: emptyFormXml
  • Type: Field (element)
  • Data Type: string
  • Value:

  • emptyFormXml is used for storing the form’s empty xml structure.
  • Name: formHasLoaded
  • Type: Field (element)
  • Data Type: string
  • Value: “no”

  • formHasLoaded is used to check if the form has loaded for the first time or not.

     

    After creating these nodes, I added the following code to the FormEvents_Loading method:

       1: public void FormEvents_Loading(object sender, LoadingEventArgs e)
       2:         {
       3:             XPathNavigator formNav = MainDataSource.CreateNavigator();
       4:             if (formNav.SelectSingleNode("/my:myFields/my:Support/my:formHasLoaded", NamespaceManager).Value == "no")
       5:             {
       6:                 XPathNavigator navBlankXML = MainDataSource.CreateNavigator();
       7:                 XmlDocument blankXML = new XmlDocument();
       8:                 navBlankXML.SelectSingleNode("/my:myFields/my:Support/my:emptyFormXml", NamespaceManager).SetValue(navBlankXML.OuterXml.ToString());
       9:                 navBlankXML.SelectSingleNode("/my:myFields/my:Support/my:formHasLoaded", NamespaceManager).SetValue("yes");
      10:             }
      11:         }

    The purpose of this code is to check to see if this is the first time the form has loaded (formHasLoaded node). If this is the first time, then you need to grab the OuterXml by creating a XPathNavigator from the form’s MainDataSource. Then you store the OuterXml into the emptyFormXml field for later use and set the value of the formHasLoaded field to “yes”.

    Now that you have captured the empty XML, you are ready to move to the next step in the process.

     

    InfoPathService Web Service

    In order to be able to submit the form into a new process, you will need to add a web reference to your project. The web URL you will need to add is: http://SERVERNAME:81/RuntimeServices/InfoPathService.asmx. The reason your adding this web reference is to be able to access the SubmitInfoPathData method. This method will submit the data of the InfoPath form to the workflow server to either start a new workflow or action a worklist item (task). For my example, I called it InfoPathWebService_Dev.

     

    Submit Clone

    Now for the “meat” of the solution! I added a button to the form called btnSubmitClone, went to the button’s properties and selected Edit Form Code. In the first part of the code, I grabbed the fields I wanted to keep from the form and stored them in a variable accordingly.

    The next step is to obtain the empty form xml that we captured earlier (emptyFormXml field). Once we retrieve that value, load it into a XmlDocument and create an InfoPath navigator off of the XML document. With the new Navigator, set the values you want to display on the new form into the new XML. One thing to take into consideration is that if the field you are trying to pass in is not a string data type, you will receive an error if you don’t delete the “nil” attribute. In order to do so, call the following method (DeleteNil) to remove the attribute:

       1: public void DeleteNil(XPathNavigator node)
       2:         {
       3:             if (node.MoveToAttribute("nil", "http://www.w3.org/2001/XMLSchema-instance"))
       4:             node.DeleteSelf();
       5:         }

     

    Now for the IMPORTANT step in the process. Set the value of the K2 serial number (/my:myFields/my:_K2/my:SN) to string.Empty. If you don’t clear the SN value, it will try to use the existing workitem’s number and will cause an error when referencing the cloned workitem.

    For my K2 workflow process, I check at the beginning of the process for a cloned form or not. In order to do this, I also created an additional field on the InfoPath form called cloneForm with a default value of “no”. Therefore, if the value is no, the process is handled normally, else, the user has to complete the form with the additional info needed after it has been cloned and then it resumes the normal process.

    k2_clone

    I set the value of this cloneForm field at this point in the process to mark the document as cloned. This only is applied with the new blank xml form I’m building, and will not change the existing form’s field value.

    The final step in the cloning process is to load the navigator’s OuterXml into a new XML document and instantiate the web service(InfoPathService) that I had referenced earlier. I then call the SubmitInfoPath method to pass the new XML document I had cloned. In order for this to submit successfully, it NEEDS to be in the following format:

       1: ipService.SubmitInfoPathData(new XmlText[] { xmlDoc2.CreateTextNode(xmlDoc2.InnerXml) });

     

    At this point, you are done with the code. Obviously, you don’t have to set any values and just submit the XML empty to have a new blank form, but it comes in handy if you want to manipulate values. Also, you can add logic to let the user choose how many clones and then loops through the process  of submitting the form the number of times the user has chosen.

    For a complete example of the btnSubmitClone_Clicked event, see below:

       1: public void btnSubmitClone_Clicked(object sender, ClickedEventArgs e)
       2:        { 
       3:             try
       4:            {
       5:                //get info to retain from form
       6:                string s_Name = e.Source.SelectSingleNode("/my:myFields/my:name", NamespaceManager).Value;
       7:                string s_Address = e.Source.SelectSingleNode("/my:myFields/my:address", NamespaceManager).Value;
       8:                string i_Zip = e.Source.SelectSingleNode("/my:myFields/my:zip", NamespaceManager).Value;
       9:                
      10:                //get empty form xml & load the xml
      11:                string cachedFullXml = e.Source.SelectSingleNode("/my:myFields/my:Support/my:emptyFormXml", NamespaceManager).Value;
      12:                XmlDocument formXDoc = new XmlDocument();
      13:                formXDoc.LoadXml(cachedFullXml);
      14:                XPathNavigator navXML = formXDoc.CreateNavigator();
      15:  
      16:                //set info to retain into empty xml
      17:                navXML.SelectSingleNode("/my:myFields/my:name", NamespaceManager).SetValue(s_Name);
      18:                navXML.SelectSingleNode("/my:myFields/my:address", NamespaceManager).SetValue(s_Address);
      19:                
      20:                //integer field
      21:                XPathNavigator xndateField = navXML.SelectSingleNode("/my:myFields/my:zip", this.NamespaceManager);
      22:                DeleteNil(xndateField);
      23:                navXML.SelectSingleNode("/my:myFields/my:zip", NamespaceManager).SetValue(i_Zip);
      24:  
      25:                //set form submission values
      26:                navXML.SelectSingleNode("/my:myFields/my:_K2/my:SN", NamespaceManager).SetValue(string.Empty); //clear K2 Serial Number
      27:                navXML.SelectSingleNode("/my:myFields/my:Support/my:cloneForm", NamespaceManager).SetValue("yes"); //field to mark item as cloned form
      28:  
      29:                //submit xml as new workflow item
      30:                XmlDocument xmlDoc2 = new XmlDocument();
      31:                xmlDoc2.LoadXml(navXML.OuterXml.ToString());
      32:                InfoPathWebService_Dev.InfoPathService ipService = new rtoq2.InfoPathWebService_Dev.InfoPathService();
      33:                ipService.Credentials = System.Net.CredentialCache.DefaultCredentials;
      34:                ipService.SubmitInfoPathData(new XmlText[] { xmlDoc2.CreateTextNode(xmlDoc2.InnerXml) });
      35:                ipService.Dispose();
      36:  
      37:            }
      38:            catch (Exception ex)
      39:            {
      40:                throw new System.Exception(ex.Message);
      41:            }
      42:        }

    Happy Cloning!!

    Be the first to rate this post

    • Currently 0/5 Stars.
    • 1
    • 2
    • 3
    • 4
    • 5


    InfoPath Form Contact Selector Control DOs and DON'Ts

    clock September 22, 2009 18:49 by author steveboldt

    If you want to add a control to your InfoPath form to do an active directory lookup, then the Contact Selector Control will work for you. In order to add this control to your form, there are some certain guidelines that need to be followed.

    DOs:

    To add the control to your form, you first need to make it available in the custom control section of your design controls section. To do so, you need to do the following:

    1. click on the Add or Remove Custom Controls … link
    2. click Add when the dialog box appears
    3. Select ActiveX Control and click Next
    4. A list of controls will appear, scroll down until you find “Contact Selector” and click Next
    5. Select the Don’t include a .cab file, click Next
    6. Select the Value binding property and click Next
    7. In the Field or group type dropdown, select Field or Group (any data type), click Finish

    At this point, the control will appear in the Custom section of your controls. Drag the control to your form. You are now ready to configure the control.

    If you right click on the contact selector and go to its properties, select the Items tab and it will show you the basic structure of how you need to set up the Data Source group. This is where InfoPath will get picky and will give you problems if you do not follow these guidelines exactly. The Data Source node should be as follows:

    MyGroup       {group}
         Person                     {repeating group}
              DisplayName       {field – string}
              AccountId            {field – string}
              AccountType        {field – string}

    MyGroup can actually be whatever you want to call it, but the other nodes, need to be spelled EXACTLY the same and are CASE-SENSITIVE!

    One last item needs to be added to the form for the control to work. You need to create an empty text document and input the following line of xml into it:

    <Context siteUrl=”http://myserver/” />

    Save the file as Context.xml and make note of it’s location. Then proceed to create a new Receive web service data connection that points to the XML file you just created and name the Data connection as Context.

    That is it, it is ready to go!

    DON'Ts:

    As mentioned above, the guidelines need to be followed exactly or you will run into problems with your InfoPath form. If you run your IP form against Design Checker, it will show you that there is no problems, but if you upload the form to SharePoint and try to access the form, you will get an error. Here are some factors that would cause your form to not render correctly if you’ve added the Contact Selector control to your form:

    1. Misspelled one of the data source field nodes in the group your created
    2. Fields are case-sensitive, and weren’t created with the correct case
    3. NO EXTRA fields can be added to the group or repeating group.

    If you were to do one of the above mentioned mistakes, you could possibly see this error when you upload your form to SharePoint and use it within a Form Library:

    naj_err

    If you were to look at the SharePoint logs, you would see the following error:

    Exception Type: System.NullReferenceException  Exception Message: Object reference not set to an instance of an object. 

    If this is the case, check to see if you made one of the 3 mistakes above. If you did, make the appropriate change and you should then upload your form again and see it display correctly.

    Currently rated 5.0 by 2 people

    • Currently 5/5 Stars.
    • 1
    • 2
    • 3
    • 4
    • 5


    How to publish K2 BlackPoint workflow & InfoPath Form Services with code behind to SharePoint

    clock September 15, 2009 19:27 by author steveboldt

    There are a lot of instructions out there on how to publish InfoPath forms with code behind to SharePoint. However, I have not come across any complete documentation on how to do this from beginning to end with K2 BlackPoint to SharePoint. One of the problems that will usually arise is that if you have multiple activities with in the K2 workflow, you will not be able to surface the IP form to the browser in succeeding steps. Usually, the form will surface in the browser on the first activity and any subsequent activities will result in the IP form trying to open in the IP client. If you follow the steps that I am demonstrating, you will be able to successfully publish and use the IP forms with code behind in combination with the K2 workflow. One thing to note, this process is applicable to K2 BlackPoint and also K2 BlackPearl.

    Enabling SSL on SharePoint Server

    Prerequisite: Certification Authority (CA) needs to be installed on the Server or need access to a CA.

    For more information regarding CA, please refer to the following links:

    http://msdn.microsoft.com/en-us/library/bb950401(BTS.10).aspx

    http://support.microsoft.com/kb/281271

    After you have created your InfoPath form that is browser-enabled and does utilize code-behind, you will need to log in to your SharePoint server. Open IIS manager and navigate to the SharePoint web application. Open the properties of this website and select the Directory Security tab. In the Secure communications section, verify that a certificate exists by clicking on the View Certificate button (figure A) and making sure the certificate is valid and issued to the website host-header. (figure B) If there is not a valid certificate, you will need to obtain a valid certificate for the site.

    Figure A

    iis_ds  

    Figure B
    iis_ca1

     

    Create InfoPath Form Library

    Log on to your SharePoint site as a Site Collection Administrator and create an empty Form Library. Once you have created the library, go to the form library settings and click on the libraries Advanced Settings. In the Content Types section, select Yes for the management of Content Types. In the Browser-enabled Documents section, select Display as a Web Page option. Click Ok.

     

    Designing the InfoPath Form Template in K2

    Assuming you have created a blank process in K2, click on the Process Wizard tab and drag InfoPath Integration onto the K2 process. Click on Add to insert a new InfoPath Form template. Configure the wizard screens as follows:

    InfoPath Form Source Location
    1. Located at: Local or Network Location
    2. Location Path: path where your InfoPath form resides

    k2_ip

    InfoPath Form Deployment Location
    1. Publish to: SharePoint Form Library
    2. SharePoint Site URL: select your SharePoint site where the form library you created resides
    3. Form Library: Click on Browse and select the form library you created earlier
    4. Select Add as library template
    5. Form Client: Web Browser

    k2_ip1

    Finish out the InfoPath Integration wizard as normal and save the K2 project. Deploy the K2 solution as normal and verify that it was successful.

    InfoPath Form Directories

    At this point, a published form directory needs to be created. Create a folder on your local machine (i.e. C:\InfoPath Published Forms). This folder will be the “Published From” folder (will be referenced as IP_FROM). The folder that is “Published To” is the location of your K2 project, and browse to the InfoPath Form Templates folder (will be referenced as IP_TO).

    Once you have deployed the K2 process successfully, browse to the IP_TO folder and copy the XSN template and paste it to the IP_FROM folder.

    This next few steps is a workaround to keep the template file with the same name. Right click the XSN template in the IP_FROM folder and click Design.

    (The following steps will only need to happen the first time the form is copied over to the IP_FROM folder. If you don’t receive the error, skip these steps below and go to the Signing and Publishing the InfoPath Form section)

    You may receive an error message the first time that looks like the following:

    xsn_warning

    Click OK and the form will open. Follow these steps:

    1. Go to File/Save As and save the file with a different name to the same directory that you just opened it from
    2. Close the form
    3. Locate the original template that you clicked Design and remember the name of the form template (should be the same as in the IP_TO folder) and delete the template
    4. Right click the new template that saved in step 1 and select Design.
    5. Go to File/Save As and save the file with the same name as the one you deleted in step 3
    6. Close the form
    7. Delete the form you saved in Step 1.
    8. Right click the form you saved in Step 5 and select Design

     

    Reason for the steps above is that when publishing the form, SharePoint will use the name of the form as the content type, and we want it to be the same name as the one in the IP_TO folder.

     

    Signing the InfoPath Form

    The form should be in design mode from the IP_FROM folder as mentioned in the previous section. Here are the steps to publish the form:

    1. Go to Tools / Form Options and select the Security and Trust category
    2. Make sure the form is set to Full Trust
    3. Under the Form Template Signature section of the Security and Trust category, make sure that the checkbox is checked for Sign this Form Template and a certificate is associated with it (see figure C).
    4. Go to the Programming category of the form options and verify the project location is correct and that it has the project file name (.csproj) as well (see figure D).
    5. Got to the Compatibility category of the form option and verify that the box is checked to open the form template in a browser (see figure E)
    6. Click OK, but DO NOT close the InfoPath Form.

     

    Figure C

    k2_ip2

    Figure D

    k2_ip3

    Figure E

    k2_ip4

    Publishing the InfoPath Form

    Once you have completed verifying the correct code behind is associated with the form and have signed the form, you are now ready to publish the form.

    1. Go to File / Publish on the InfoPath form

    2.  Select the first option where you want to publish the form template to a SharePoint server, click Next.

    k2_ip5

    3. Type in the location of your SharePoint site, click Next

    k2_ip6
    4. Make sure the box is checked for Enabling the form to be filled out by using a browser, click Next. k2_ip7 5. Browse to the location of the form template that is in the IP_TO folder (the K2 InfoPath Form Templates folder of the project).

    Note, first time through these steps, the wizard will ask you if you want to overwrite the template, go ahead and save over the template.
    k2_ip8
    6. If you want to add columns, to the content type, you can do so here, else click Next. k2_ip9 7. Verify the info is correct and click Publish. k2_ip10
    8. Click Close and then close the InfoPath Form. k2_ip11    

     

    Uploading and Activating InfoPath Form on SharePoint

    At this point, you are ready to upload the form template to SharePoint. Open up an instance of SharePoint Central Administration and browse to Application Management. Locate the InfoPath Form Services section and click on  Manage Form Templates. Click on Upload Form Templates link. In this screen, where the text box is to insert the file name, click the Browse button and navigate to the IP_TO folder where you just finished publishing the form to. Select the XSN file you published and click Open.

    sp_upload

    Click the Upload button and wait until the next screen appears showing the form uploaded successfully.

    sp_upload2

    Once you click OK, it will return you to the Manage Form Templates page and verify the form you just uploaded is in the Ready status. If it is not, refresh the page until it is.

    Navigate to your Site Collection and complete the following steps:

    1. Click on Site Actions of the site collection.
    2. Select Site Settings
    3. Under the Site Collection Administration section of the site settings, click on Site Collection Features.
    4. Locate the form template you just uploaded and click Activate.
    5. Now browse to your Form Library that you created earlier and select the form library settings
    6. Locate the Content Types section and click on Add from existing site content types.
    7. In the available content types box, select the content type (your InfoPath form name) and Add it to the box for content types to add and click OK.
    8. Click on Change new button order and default content type and uncheck the box to make the FORM content type NOT visible and change the position from top of your new content type to 1 and click OK.

     

    This completes the steps to publish and upload an InfoPath form with code behind to SharePoint. You can now browse to your form library and click New and your form will now open in the browser!

    Currently rated 5.0 by 3 people

    • Currently 5/5 Stars.
    • 1
    • 2
    • 3
    • 4
    • 5