July 2009 - Posts - Mel Balsamo
in

InfoPath Dev

This Blog

Syndication

Mel Balsamo

July 2009 - Posts

  • Add a repeating Electronic Signature template part

    Qdabra’s Electronic Signature template part allows you to add signature images into your InfoPath solutions. This blog post describes Qdabra’s Electronic Signature template part in full detail. If you have not learned about this XTP, please read that blog post before continuing.

    There may be times when we want multiple users to electronically sign a single InfoPath form, hence making the template part section repeating. This blog post details the steps on how to create a sample InfoPath form with a repeating Electronic Signature template part.

    1. Design a new, blank InfoPath form template.

    2. In your Data Source taskpane, add a repeating group called RepeatingES and drag it onto your view.

    3. Place your cursor inside the RepeatingES repeating section.

    4. Switch over to your Controls task pane and select your Electronic Signature template part.

    Your form template should look similar to this: 

    5. Modify your Validate check box rules.

    a. Double-click on the Validate check box to open its properties, and then click Rules.

    b. Modify the Valid rule’s condition:

    i. In the Rules dialog box, select Valid and click Modify

    ii. In the Valid rule dialog, click Set Condition

    iii. In the Condition dialog’s first drop down box, select “The expression”. 

    iv. Paste the following custom XPath inside the text box:

    ../my:UserInfo/my:PIN = xdXDocument:GetDOM("PIN List_ElectronicSignature")/dfs:myFields/dfs:dataFields/dfs:Pin_List/@PIN[../@Title = current()/../my:UserInfo/my:UserName] 

    v. Click OK twice to return to the Rules dialog.

    c. Modify the Invalid rule’s conditions:

    i. In the Rules dialog box, select Invalid and click Modify

    ii. In the Invalid rule dialog, click Set Condition

    iii. In the Condition dialog’s first drop down box, select “The expression”. 

    iv. Paste the following custom XPath inside the text box:

    ../my:UserInfo/my:PIN != xdXDocument:GetDOM("PIN List_ElectronicSignature")/dfs:myFields/dfs:dataFields/dfs:Pin_List/@PIN[../@Title = current()/../my:UserInfo/my:UserName]

    v. Change the second condition’s first drop down value to “The expression” and paste the following custom XPath:

    ../my:UserInfo/my:UserName != xdXDocument:GetDOM("PIN List_ElectronicSignature")/dfs:myFields/dfs:dataFields/dfs:Pin_List/@Title[../@PIN = current()/../my:UserInfo/my:PIN]

    vi. Add a third “OR” condition using the expression:

    ../my:UserInfo/my:UserName != xdXDocument:GetDOM("PIN List_ElectronicSignature")/dfs:myFields/dfs:dataFields/dfs:Pin_List/@Title

    This new third condition is required for cases when neither the UserName nor the PIN are found in the list, otherwise no error is returned.

    Your Invalid rule’s Condition dialog should look similar to this: 

    vii. Click OK until all the dialogs are closed.

    6. Finally, test your form template in Preview mode. 

    After testing that all the validation works as expected, you can then publish your solution to your SharePoint site.

  • Configure the Electronic Signature template part to work in browser-enabled forms

    Qdabra’s Electronic Signature template part features the ability to add signature images into your InfoPath solutions. These can be scanned-in signatures that are saved as images and are stored in a SharePoint picture library. This blog post describes Qdabra’s Electronic Signature template part in full detail. If you have not learned about this XTP, please read that blog post before continuing.

    Many organizations find this template part useful, but how about those that that use browser-enabled forms? We know that images are not allowed in form templates that are designed for InfoPath Forms Services (IPFS). But there is a way to use electronic signatures! With a little tweaking and modifying, we can get that template part to work in your browser-enabled forms. Here’s how:

    1. Open the Electronic Signature template part (qESxtp) in InfoPath Design mode. 

    2. Go to File > Save As and give it a different name such as qESxtp-Web.

    3. Delete all unneeded data connection and fields.

    a. In Tools > Data Connections, delete the connection that retrieves images from your SharePoint picture library. (You may have named it “Verify PIN”.)

    b. From your main data source, delete the LibraryURL field: /my:qESxtp/my:UserInfo/my:LibraryURL.

    c. Delete the Signature field: /my:qESxtp/my:Sign/my:Signature. Remove the Picture control in your view as well.

    Your template part should now look similar to this: 

    4. Change the default value of the DisplaySignedBy field: /my:qESxtp/my:Sign/my:DisplaySignedBy

    a. In your Main data source task pane, right click on the DisplaySignedBy field and select Properties.

    b. Click on the fx icon next to the Value textbox: 

    c. In the Insert Formula dialog, delete the XPath that previously referred to your SharePoint picture library: 

    d. Click on the Insert Field or Group button.

    e. Switch over to your PIN List (Secondary) data source, expand dataFields > PinList, then select Title

    f. Click on the Filter Data button, then click Add.

    g. Add a filter such that the Title from your SharePoint list is equal to the UserName in your main data source, i.e. /dfs:myFields/dfs:dataFields/dfs:PinList/@Title is equal to /my:qESxtp/my:UserInfo/my:UserName

    h. Click OK.

    Your new formula for the DisplaySignedBy field should be similar to this: 

    i. Click OK to close all the dialogs.

    5. In your validation rule, delete the action that previously referred to the Signature field.

    a. Double-click on the Validate checkbox to open its properties.

    b. Click on Rules and modify the Valid rule.

    c. Click on the second action from the list: 

    d. Click on the Remove button.

    You should now be left with two actions in your Valid rule: 

    e. Click OK to close the dialog box.

    6. Add a condition to display an error if the user enters a Name that does not exist in the SharePoint list:

    a. Still in the Rules dialog of your Validate checkbox, modify the Invalid rule.

    b. Click on the Set Condition button.

    c. Modify the second condition that previously referred to the Signature field:

    i. Click on the first drop-down box, then click Select a field or group

    ii. From your Main data source, select the UserName field, then click OK

    iii. Change the second drop-down selection to is not equal to: 

    iv. Click on the third drop-down box then select Use a formula.

    v. In the Insert Formula dialog, click on the Insert Field or Group button.

    vi. Switch over to your PIN List (Secondary) data source, expand dataFields > PinList, then select Title

    vii. Click on the Filter Data button, then click Add.

    viii. Add a filter such that the PIN from your SharePoint list is equal to the PIN in your main data source, i.e. /dfs:myFields/dfs:dataFields/dfs:PinList/@PIN is equal to /my:qESxtp/my:UserInfo/my:PIN 

    ix. Click OK four times to go back to the Condition dialog box.

    Your second condition for the Invalid rule should look like this: 

    x. Click OK three times to return to the Validate check box properties window.

    7. Remove the conditional formatting for the Validate check box that previously referred to the Signature field:

    a. In the Validate check box properties dialog, click on the Display tab.

    b. Click on the Conditional Formatting button and modify the existing condition. 

    c. Click on the Remove button in the first condition.

    You should now have only one conditional formatting in your Validate check box: 

    d. Click OK to close all the dialogs.

    8. Change the conditional formatting for the UserInfo section that previously referred to the Signature field.

    a. Double-click on the UserInfo section and select Conditional Formatting

    b. Remove the existing condition: 

    c. Add two new conditions that hide the control when:

    i. Validate is equal to TRUE; and:

    ii. DisplayError is equal to FALSE 

    d. Click OK until all the dialogs are closed.

    9. Finally, save your template part.


    Remember that you would need to remove the old Electronic Signature template part in your InfoPath Custom controls and then add the latest version. You can then update your existing browser-enabled forms with the new version.

Copyright © 2003-2018 Qdabra Software. All rights reserved.
View our Terms of Use.