Mel Balsamo
in

InfoPath Dev

This Blog

Syndication

Mel Balsamo

  • How To: Save Images to SharePoint

    Prerequisites:

    • You should already have FormsViewer installed and understand how to upload and open forms.
    • You should already have an XSN form template that includes a Picture Control or File Attachment Control. If you are not familiar with Picture Controls, please see our How To: Capture Camera Images
    • Your form template should already be injected with qRules.

    Steps:

    1. In SharePoint locate or create document library that you would like to use for storing images or files from your form.

      image01

    2. Open your form in InfoPath Design mode.
    3. In the Fields pane, locate the base64Binary field from which you would like to save out files to SharePoint.

      image02

    4. Add a qRulesLink attribute to the field:
      1. Right-click the field
      2. Click Add…
      3. Enter the name qRulesLink (use this exact spelling and capitalization)
      4. Click OK
    5. Repeat step 4, but with the name qRulesFilename instead of qRulesLink.

      image03

      Note: Your data source may or may not be repeating depending on your needs. In this example, we are allowing users to attach more than one photo in the form so we’re showing a repeating group.

    6. Make sure that the Rules taskpane is open.
    7. Add a formatting rule to hide the control when the file has been saved out:
      1. Locate the Picture or File Attachment Control that is bound to your field and click it.
      2. In the Rules pane, click New à Formatting
      3. Give the rule the name “Hide when file saved”
      4. Under Condition: click the blue None text.
      5. Using the condition builder:
        1. Use the left dropdown to select the qRulesLink
        2. Use the middle dropdown to select is not blank.
        3. Click OK
      6. Check the Hide this control box.

        image04

    8. Add a section control and hyperlink for the link to the file:
      1. Use your mouse to drag your picture or attachment field from the Fields pane to a location right next to your Picture or Attachment control.
      2. When prompted for a control type, click Section.
      3. Click to place your cursor inside the newly created Section Control.
      4. Select the Insert tab and click Hyperlink.

        image05

      5. When prompted for the hyperlink’s properties:
        1. For Link to, select the qRulesLink
        2. For Display, select the qRulesFilename

          image06

      6. Click OK.
      7. Click and drag the right edge of the Hyperlink so it fills most of its container.
      8. If you wish to display a thumbnail of the linked image aside from the link itself, drag the qRulesLink field inside the section as a Picture control – right-click on the field on the Fields taskpane, select More and then select Picture

        image07

      9. Set the control as read-only and also adjust the qRulesLink photo control with a fixed width or height of your choice so that it appears like a thumbnail on your form.

        image08

    9. Add a formatting rule to hide the section control when the file has not been saved out:
      1. Repeat the sub-steps from step 7, with these differences:
      2. Instead of clicking the Picture or File attachment, click the Section control you created in step 8-b.
      3. Instead of selecting is not blank in the condition builder, select is blank.

        image09

    10. Add a button to your view and give it meaningful text like “Upload Photo”
    11. Add a rule to the button to save out the image:
      1. Click the button.
      2. In the Rules taskpane, click New à Action
      3. Click Add à Set a field’s value
      4. In the Set a field’s value dialog:
        1. For the Field, select the Command field in the QdabraRules secondary data source.
        2. For the Value, paste the following command text, and replace the highlighted parts as indicated: SaveToSharePoint /url=[full URL to SharePoint library, up to the library’s name] /xpath=[full XPath to your picture or file field]

          image10

        3. Click OK
    12. Save the template and upload it to FormsViewer.
    13. Open the form in FormsViewer, add a file to your Picture or File Attachment Control.
    14. Click the button to upload the file.

      image11

    15. If it worked correctly, you should see the Picture or File Attachment Control disappear and it should be replaced with a thumbnail and a link to the saved out file. Clicking the link should take you to the uploaded image into the SharePoint library, showing full resolution.

      image12

      image13

    Notes:

    • If you are saving out pictures, replace the hyperlink with a Picture control that is bound to the qRulesLink This control should display the picture by loading it from its location in the library.
    • Try the above steps on a picture or attachment field in a repeating group/repeating section. The SaveToSharePoint command should work without any additional changes.
    • Add the rule from your Save Files button to your form’s Submit button. Place this rule before the rule that actually submits the form. This should cause files to save out before your form is saved, reducing the size of your documents and the speed of your submits.
  • How To: Capture Camera Images

    Prerequisites:

    • You should already have FormsViewer installed and understand how to upload and open forms.

    Steps.

    1. Create a new form template or open a form template that you already have in InfoPath Design mode.
    2. Locate or create a group in your form’s main that would be suitable for storing the image you want to add.
    3. Right-click the group in the Fields taskpane and click Add…
    4. Enter any valid field name for the field. For Data Type, select “Picture or File Attachment (base64)”. Click OK.
    5. Drag the newly added field into the location in your view where you would like to add it. When prompted for a control type, select Picture.
    6. Save your form template.
    7. Upload the template to FormsViewer and open it.
    8. Click the image control that you added.
    9. You should see a popup dialog with a file attachment control. Click the file attachment control to select a file.

      image01

    10. Select a picture file to use.
      1. If you are viewing the form on a mobile device, you may have the option to take a picture using your device app as an alternative to selecting a file, like so:

        image02

    11. Click OK.
    12. The picture should now be shown in your form.

    Optional:

    • Modify the picture control’s properties to give it either a fixed width or fixed height. You can use this to prevent it from becoming too large.
    • Use the same field to create additional Picture Controls in different areas of your form’s view, or in other views. This will allow your users to attach pictures in one part and view them in other parts of the form.
      • You can also modify some of the Picture Controls’ properties as described above, to show a smaller version of the pictures in certain parts of the form.
  • How To: Add Signature Capture to your Form

    Prerequisites:

    • You should already have FormsViewer installed and understand how to upload and open forms.
    • You should have an XSN form template that has been injected with qRules.
    • You should have the Signature Prototype form included with this document (Download the package here)

    Steps:

    1. Export all resource files except QdabraRules.xml from the Signature Prototype XSN.

      image01

    2. Add the .js and .css files to your own XSN as resource files.

      image02

    3. Add a Section control to your form. This will serve as a placeholder for the signature control.
      1. Place some placeholder text in this section control, like “Find me”. You will use this in step 7 to locate the section in the form’s source in step 7.

        image03

    4. Add a Picture control to your form along with a corresponding base64 (Picture or File Attachment) field.
      1. When you select Picture from the Controls pane, select the option to include it in the form.

        image04

      2. Place this inside the Section control from step 3.

        image05

      3. Click the control to select it and add a formatting rule to hide it when it is blank.

        image06

    5. Add a button to the view for the purposes of showing the signature control. Give this button some text like “Sign this form” and a meaningful ID. Make note of this ID for use in step 8.

      image07

    6. Save the form as an XSN file and extract its source.
      1. If you are unsure how to extract the form’s source, you can do this:
        1. Click the File tab
        2. Click Publish
        3. Click Export Source Files
        4. Locate or create a folder where the source files will be extracted. This will create several files in the destination folder, so it is usually best to select an empty folder or create a new folder for this.
        5. Click OK
    7. Locate the source files you extracted, and use a text editor to open the view XSL file corresponding to the view where you are adding the signature control. Locate the Section control you created in step 3. It will most likely be in the format CTRL[number] make note of this ID for use in the next step.
      1. If you are not sure how to locate the Section control, you can do the following:
        1. Within the text editor, search for the placeholder text you added in step 3 (e.g. “Find me”). When you’re done with all the steps in this document, you may delete this placeholder text.
        2. This should take you to roughly the location of the Section control. Look in the near vicinity of the located placeholder text for a <div> tag with an xd:xctname="Section" attribute.
        3. Make a note of the xd:CtrlId attribute on this tag. (e.g. CTRL3)

          image08

    8. Edit the SignatureConfig.xml from the exported resource files of the Signature Prototype XSN and add the needed config settings.
      1. Open the XML in a text editor such as Notepad.
      2. ButtonId is the button ID from step 5.
      3. PlaceholderId is the ID of the Section control that you determined in step 7.
      4. DestPath is the full XPath of the picture field from step 4.

        image09

    9. Back in the InfoPath Designer, go to Data > Data Connections and add a receive XML data connection for your modified SignatureConfig.xml – name it SignatureConfig.

      image10

    10. On the finishedLoading field in the QdabraRules data source, add a rule to load the .js and .css files using LoadResource. (You can imitate the rule in the same location in the sample form. It should involve three LoadResource commands:
      • LoadResource /name=jquery.signaturepad.min.js
      • LoadResource /name=Signature.js
      • LoadResource /name=Signature.css

        image11

    11. Save, upload the form to FormsViewer, and try it out.
      1. Click the button you added in step 5 to reveal the signature control.

        image12

      2. Add a signature by clicking and dragging your mouse across the gray area.

        image13

      3. Click Capture Signature to capture an image of the signature. This will store an image of the signature in your image field and hide the signature control.

        image14

    12. (As needed) To add more signature controls to the same form, repeat steps 3-9. In step 8, add one <Signature> element to the SignatureConfig file for each signature control and update the SignatureConfig data source instead of creating a new one.

      image15

  • Query Forms from within other Forms

    You may download the files used in this blog post from this link

    Overview

    Sometimes you have a form and you want to show another form's data, without actually copying it into your form.

    In other words, you don't want to include the queried form into your form. You just want to link the forms together and show the related form as a reference.

    How do you add this "satellite" form to your main form without impacting the design of your main form?

    In this blog, we'll show you how to query and display data from a separate satellite form without ruining the integrity of your main form.

    Requirements

    • You are a site collection admin.

    • Your site has the FormsViewer App installed, or your SharePoint admin can install it.

    • You have an InfoPath form or access to InfoPath Designer to create one.

    Sample Scenario = Policies

    Every business process needs a policy. The policy may change throughout the year. For example, an expense report may require receipts for expenses exceeding $100 this year, but this limit may be raised to $150 next year. The business process admin should be able to update the policies by going in to the Policy library and adding/updating forms.

    Usage Scenario

    View Policy

    1.       User opens up your form

    2.       Clicks on Show Policy

    3.       If no matching policy exists, Main form shows "No policy document"

    4.       If policy form exists, Main form queries the policies form

    5.       Main form displays the policy

    Add or Edit Policy

    1.       Business Process Admin adds a new policy with the name for the main form which it will target

    Components

    To implement, you will need the following:

    • Policies Form - required

    • Policies XTP - generic XTP that can be configured

    • Your Main Form - where you insert the XTP

    Technique

    Query the Policy form library using the URL for the Main form (as if it is a unique ID to search for a policy).

    Here’s how the Policy Form looks like – simple and straightforward.

    image1 

    Publish your Policy form into your SharePoint library. Submit your business process policies using that form, specifying the Target Form Name, e.g. Expense Report, Leave Request, etc. and entering your Policy text in the rich text field which allows formatting, paragraph breaks, etc.

    Here’s an example of a filled-out Policy form:

    image2 

    There’s also the Policy XTP (template part) that allows easily adding policies into your forms. Here’s how it looks like in the Designer:

    image3 

    Add the XTP into your InfoPath Designer Custom Controls:

    image4 

    We will add the Policy XTP into the Expense Report form that ships with InfoPath 2007.

    image5 

    Follow the steps provided in the XTP – we made it very simple and user-friendly for you! J

    Key notes:

    • Make sure to enter the same form name you specified when you submitted the Policy Form. Recall that we submitted policy and gave it a Target Form Name of “Expense Report”

    image6

    The same name should be specified as the default value in the Policy XTP section’s TargetFormName field:

    image7 

    • In the PolicyLibraryUrl field, enter the URL to the library where you published the Policy Form to. Make sure to include the trailing slash, like so:

    image8

    • The XTP appended the “_Policy” text in the data connection names so you’ll need to rename the data connection for QdabraRules (only) so that FormsViewer recognizes the commands.

    image9

    Those are all the changes needed – super easy! J

    How the Magic Happens

    All the rules are placed in the Show Policy button:

    image10 

    We use the following commands/technique:

    • ChangeConnectionUrl – to change the URL of the BusinessProcess_Policy XML data connection

    image11

    We are basically telling our form to get the policy text from the Policy Form library to the form where we added the XTP to, in this case, the Expense Report form.

    • CopyRichText – if a policy has been submitted for our form, we then copy the value from that Policy form into our Expense Report form.

    image12

    Since we’re copying to and from a rich text field, we use the command CopyRichText in order to keep any rich text formatting.

    That’s all there is to it! When you’re done setting it up, publish your form into FormsViewer and test out your changes.

    image13 

    image14 

    Have fun! J 

  • Create a Child Form from within a Parent

    (Click here to download the files used in this blog post.) 

    Overview

    When you're designing a form, you don't need to include "everything but the kitchen sink”. I confess abusing this idiom in the past. It means "almost anything one can imagine". I have used "kitchen sink" as a metaphor for an InfoPath form from hell that has everything thrown into it. Visually, I imagine a kitchen sink so full that it is impossible to wash the dishes.

    It's easy for a form to become bloated and unwieldy.

    For example, imagine that you have a simple Expense Report form that submits to a SharePoint library. Good job! You publish and people start using it and they are happy for a month or so. Then, you get a feature request to add a simple approve-request workflow. So, you add a "Change History" section to your form (we have an XTP for this) and promote properties for the last modified user and date-time fields to integrate with a new SharePoint workflow. This makes sense because you can now measure the time between submit and approval or rejection and resubmit, etc. You can't do that with SharePoint workflows, so it makes sense to add this repeating block to your form. Fine. Another month goes by and somebody wants you to add a Expense Policy to the form. Now, you know that there are many business policies in your org and during a slow Tuesday afternoon you daydream of creating a general form for policies and linking them together but then when Wednesday rolls around, you're slammed with other work and you just don't have time to do that so you hard-code the policy into the form and that gets the job done, but you know you'll have to republish with every update. Let's hope the policy doesn’t change often.  After another month and yet more feature requests and suggestions, you finally put your hand to your head and in a flash of insight realize that whack-a-mole is the wrong game for you. Instead, you will design a place in your form where users can submit suggestions.  You will automate the task of improving your form and in the process get control of your work week back. You will schedule one time every two weeks to review form feedback and schedule changes. Life will be orderly.  Only one problem: how to extract suggestions saved in the Expense Report form…

    Here's where it makes sense to have two dishwashers. You've got one for glass stemware and another for pots and pans. Different cycles for different dirtiness. Your Expense Report form and Suggestions will be in different libraries. The Expense Reports need to be processed quickly. The suggestions, not so much. OK, that's the idea, but how to extract the latter suggestion from the former expense report and yet still give people a "ticket #" so that they feel like their suggestion didn't end up in the black hole of SharePoint?

    With Qdabra's easy-to-inject Suggestions XTP, you can add a Suggestions section to your form and have it saved to a separate library.

    Requirements

    • You are a site collection admin.
    • Your site has the FormsViewer App installed, or your SharePoint admin can install it.
    • You have an InfoPath form or access to InfoPath Designer to create one.

    Sample Scenario = Add a Suggestion Box to your form

    Adding a Suggestion Box to your form is a great way to capture feedback, and defuse negativity of a new process. If someone calls to say there's a bug, you can have them enter it into the suggestion box right away and promise them some turnaround.  They're happy you listened.

    qRules has a command called SubmitToSharePoint which users to create a different XML document and submit to a SharePoint form library. It supports “create” and “update” actions for XML fragments based on an XML mapping.

    How it Works

    This lab provides a Suggestion form and a Suggestion template part (XTP). If you open both in InfoPath Designer and compare the Suggestion form’s main schema against the XTP’s Suggestion secondary data source schema side-by-side, you’ll see that the XTP contains the schema of the Suggestion form.

    Suggestion Form:

    Suggestion XTP:

    When you add the Suggestion XTP into your form, the XTP will add the schema as an XML to the secondary data source.

    Design the Form that Submits Suggestions

    For your convenience, we are providing a sample form template that you can start with. You will continue designing this form as if it’s one of your company’s solutions.

    1. In InfoPath Designer, open the template named xsn.
    2. Add your fields and controls – you can add any field you want; but for the purpose of this exercise, we’ll add fields for Suggestion, Project, Submitter, and FormName; and use text box controls on the canvas.

    1. Publish the form to a Library.
      1. Click File Publish SharePoint Server.
      2. Enter the training site URL (https://training2013.formsboard.com/MastersCourse/). Click Next.
      3. Select Form Library and click Next.
      4. Select Create a new form library and click Next.
      5. Enter a unique name for your form library. For example, <YourName>_Part12_Lab1.
      6. Click Next twice and Publish.
    2. Add your Submit and Close buttons

    1. Create a Submit to Library data connection
      1. Under the Data tab, click Data Connections.
      2. Add a Submit data connection that submits To a Document Library on a SharePoint site.
      3. Enter the URL for the library created in step 3.
      4. For the File name, click the fx button and select the FormName
      5. Click Next until you reach the last page of the data connection wizard.
      6. Leave the SharePoint Library Submit name as is, and click Finish to exit the data connection wizard.
    2. Double click the Submitter field, click the fx button, and enter the formula userName().
    3. Click on the Submit button.
    4. Under the Home tab, click Manage Rules.
    5. Add an action rule named Generate FormName.
    6. Click the Condition
    7. For the first dropdown, select the FormName
    8. Select “is blank” from the second dropdown.

    1. Add an action that sets the FormName field

    1. Click the fx button and enter the formula: translate(concat(Project, "-", Submitter, "-", now()), ' ~#%&*{}<>:,?\/|"+.…', "_____________________")
    2. Highlight Project and click the button Insert Field or Group
    3. Select the corresponding Project field and perform the same step for the Submitter
    4. Click OK
    5. Add another action rule that Submits Data using the SharePoint Library Submit data connection, and name the rule accordingly.
    6. Save the form and click the quick publish icon  located at the upper left section of your screen to perform a quick republish.
    7. Perform a test submit to verify the submit works – the XML generated will be used for identifying the Processing Instructions of the XML.
    8. Download the generated XML and save it on your desktop or downloads folder. 

    Add the Suggestion XTP

    You will then add the Suggestion XTP that will allow suggestions to be submitted into the target Library we created earlier.

    In this section, you may use any form you wish to use but for purposes of training, a QdExpenseReport-Sample pre-injected with qRules form has been provided.

    Note that qRules is required. You may need to inject your form with qRules if you are using a different form.

    1. Add the XTP in InfoPath Custom Controls.

    1. Drag the Suggestion XTP on your form canvas.

    This is how the XTP looks like on the design canvas:

    In your Fields task pane, notice that the XTP added groups and fields into your main data source.

    If you go to Data > Data Connections, you will see that the XTP also added data connections:

    And if you select the Submit Suggestion button then display the Rules task pane via Home > Manage Rules, you’ll see the pre-configured rules:

    These are just some of the benefits of using XML Template parts (XTPs) – it adds almost everything for you; in short, you let the XTP do the hard work. Another huge plus is that you can use XTPs in as many forms as you want.

    Modify the XTP

    We will make a few modifications to the Suggestion section so that it meets our form’s needs.

    1. Move the light bulb icon (drag-and-drop) where you want it to appear on your form.

    1. Add data connection that submits to the Suggestion Form library.
      1. Under the Data tab, click Data Connections.
      2. Add a Submit data connection that submits To a Document Library on a SharePoint site.
      3. Enter the URL for the Suggestion Form library.
      4. For the File name, click the fx button and select the node /ns1:SuggestionForm/ns1:FormName from the Suggestion_ Suggestion secondary data connection.
      5. Click Next until you reach the last page of the data connection wizard.
      6. Provide a meaningful name such as SubmitSuggestion, and click Finish to exit the data connection wizard.
    2. Click Submit Suggestion button
      1. Modify Action rule named Insert PIs - set target field to qRules Command node for both actions.
      2. Modify Action rule named Submit to Suggestion Library - set target field to qRules Command node
    3. At the Xtp_Logic_Suggestion secondary data connection, click the node /XtpLogic/Action/SetXMLValues
      1. Modify Action rule name Set Library Name* - set Value to the Library name of the Suggestion Form (not the Expense report form)
      2. Modify Action rule name Set URN* - set Value to the URN of the Suggestion Form
        1. Open Suggestion Form in deign mode
        2. Go to File > Info > Form template Properties
        3. Copy the URN from the ID section
        4. Exit form
    4. Back at the Submit Suggestion
      1. Click the first rule named Set Values.
        1. Modify the value of the action that sets the Project field to a value you desire – this should correspond to the current form you are adding the submit suggestion xtp to.

      2. Modify the second rule named Insert PIs.
        1. Open the XML saved in step 21 using a text editor such as notepad.
        2. On the first action, update the corresponding values for the following Processing Instruction attributes:
          • solutionVersion
          • productVersion
          • PIVersion

        3. On the second action, verify if the values for the /data parameter are the same. If not, update the attribute values accordingly
          • InsertPi /dsname=Suggestion_Suggestion /name=mso-application /update=true /data=progid="InfoPath.Document" versionProgid="InfoPath.Document.3"
        4. Double check the /dssubmit parameter value – make sure that the value is the same as the Submit to Library data connection name create in step 25 g. By default this should be: SubmitSuggestion
    5. Save your final template.

    See it In Action!

    Now that we have set it all up, we are ready to test our solution.

    1. Publish your form template to SharePoint by creating a new Library (see step 5 for reference).
    2. After Publishing the form, Open a  new document.
    3. Submit a suggestion.
      1. Click on the light bulb icon where you placed it.
      2. The Suggestion box should appear – fill in the fields.
      3. Click on the Submit Suggestion

    1. You should see a link to the submitted suggestion.

    1. Click on the link to open the Suggestion form that you just submitted.

     

  • Send a Form Link via Workflow

    Overview

    How about approving workflow requests via email with one click?

    With Qdabra's easy-to-install FormsViewer app, you can do this and more.

    Wouldn't it make even more sense to approve workflows from a phone without having to login to SharePoint?

    Well, now with FormsViewer, even external users can approve requests. One click. No log in required.

    Faster, better, easier - that's FormsViewer!

    Important: please don't attempt this while driving.

    Requirements

    You are a site collection admin.

    Your site has the FormsViewer App installed, or your SharePoint admin can install it.

    You have an InfoPath form or access to InfoPath Designer to create one.

    Sample Scenario = Leave Requests

    A Leave Request form is a common scenario where approvals are required.

    Steps 

    Employee requests personal time off (PTO)

    1. Employee navigates to HR site

    2. Employee clicks on Submit Leave Request

    3. Employee fills out form and submits

    Manager is notified

    1. Manager receives an email summarizing the PTO request

    2. Manager clicks on link to approve or reject request

    Components

    To implement, you will need the following:

    • One Leave Request form (InfoPath)

    • One Manage Leave Request form (InfoPath)

    • One SharePoint 2010/2013 workflow

    Note: You can download and install our Leave Request solution from the Qdabra web store here:
    http://www.qdabra.com/webstore/p/1152/leave-requests-form

     

    Technique

    To approve or reject a request with one click, you need to tell the form whether you are "approving" or "rejecting" when you click. So, there are two links. One link has "&Approval=Approved" and the other has "&Approval=Rejected".

    To create these links and send an email we will use SharePoint Designer…

    Here's the workflow:

    image1

    Here's the email:

    image2

    Here's the link for "Approved":

    image3

    image4

    To create a link for rejecting, you just change the "&Approval=Approved" to "&Approval=Rejected".

    Now, let's take a look at the form.

    Qdabra's Leave Requests solution has a form for submitting requests (Leave Requests form) and a form for managing the leave requests. Both are included in the package.

    The workflow that sends emails with the approve-reject links is associated with the former Leave Requests form.

    But, the links themselves point to the latter Manage Leave Requests form.

    The Manage Leave Requests form opens when the manager clicks the link and there is logic after form load that sets the approval status based on the command that was passed.

    Here's how the form canvas looks like in InfoPath Designer:

    image5a 

    Here are the rules that get the approval status:

    image5b 

    Notice that we are using the qRules command "GetInputParameter" to query the link for the Approval key. This key indicates whether the manager has "approved" or "rejected" the request.

    After obtaining the approval status, we next need to get the ID of the form:

    image6

    Once again, we are using the qRules GetInputParameter command to query the form's ID from the link.

    After getting the link, we can query the form:

    image7

    Notice that the rule queries the form from the Leave Requests library - that is where it was submitted.

    Next, the form updates the library based on the approval.

    image8

    That's all there is to it.

    Just create a workflow link that appends the form's ID and the Approval command. Then, in the form use qRules GetInputParameter to query these values from the link and perform some actions based on what they are.

    To do this even if the user is not logged in, just add one more parameter:

    image9

    Of course, you'll want to look at the samples. :)

  • Get rid of that "Control binding is not supported" error on your Design Checker!

    Got calculated values on your InfoPath browser form? Do they involve filters and/or complex formulas? Surprised to find out that as soon as you're ready to publish your form, there goes the Design Checker error on the taskpane --- "Control binding is not supported"

    Hilary, one of our InfoPath experts, blogged something about this - here's her post. She suggested a workaround of manually modifying the form source files which wondefully works. Her readers asked if there's a way to do this without tinkering with the source - there is indeed! And it is easy... read on!

    To reproduce the scenario and better understand when this issue actually occurs, create a simple form by following these steps:

    1. Add a repeating table with 2 columns.
    2. Add a calculated value control and set it to display the repeating group's field1 node - we know that this will display only the first row's field1 value, but we won't care about that for now.
    3. Go to File > Design Checker --- no errors, good! Not surprising, but good.
    4. Add another calculated value control - the value this time will be the field1 node filtered when field2 is not blank. So you'd select Calculated Value from the Controls menu > click on the fx button > Insert Field or Group > select field1 > Filter Data > Add > field2 is not blank > click OK five times.

      Here's what we have so far:

      Let's preview the form to make sure it's working so far...


    5. Close Preview and click Refresh on the Design Checker pane - still no error...

      And here's where we try reproducing the issue - we'll make that design checker error appear...

    6. Right-click on the first calculated value's control and select Calculated Value Properties > click on the fx button and just click OK twice to close it without changing anything - just humor me here, ok? Now click Refresh again - no error.
    7. Repeat the same actions on Step 6, this time with the second calculated value --- so look at the formula in the properties dialog box, don't change anything and hit OK to close it.

    Click Refresh --- bam! There's your error.

    At this point, we'll wonder - is it a bug in InfoPath? I don't know. But here's where I think Hilary's observation comes to play - it might've already added that "xd:binding" attribute in the xsl file as soon as we clicked OK, InfoPath thinking that we "modified" it. If you Undo once from that last step and refresh again, the error will go away. But who can keep track? (Note to self: don't click OK in edit mode dialogs when I really did not change anything - there's a Cancel button after all!)

    The solution, aside from manually modifying the source files, is to ---- delete the calculated value and add a fresh one! Yes! But before you delete, make sure to grab your formula first - copy it, so that you won't need to rebuild it on your fresh calculated value as you can just paste the expression in the formula box. Now that's easy enough, at least for me.

    So we know that this will occur everytime you'd go to the formula and edit it (what a pain). Again, who can keep track? The goodness left in this is that InfoPath will still be friendly enough to point all instances of this error when it's time to publish your form. So keep working, just keep adding your calculated values, modify them all you want. When you publish, you'd end up with 10 or more errors like this, but when you click on each, your cursor will point to the exact calculated value that needs to be recreated. You can then fix them all at once.

    Hope this helps...

  • Add a dog ear to your form

    From this:

     

    To this:

     

    That looks like a "dog ear" to me, pretty much.

    Adding this requires a little knowledge with Adobe Photoshop, but the steps should be straight-forward. So, if you're ready – grab the PSD file here.

    1. Open QdHeader.psd in Adobe Photoshop.

    2. From the Layers pane, select Corner.

     

    This will select the "dog ear" image from the canvas.

     

    3. From the vertical toolbar menu, set the foreground color to your desired border color – let's pick red for this example.

     

    4. Select the paint bucket tool.

     

    5. Click the border portion of the dog ear to color it.

       

    6. Repeat the same steps for the right, left and top borders, selecting the layer first and then using the paint bucket tool to change the color.

    7. You can change the remaining yellow-colored portion of the "dog ear" to match your form view's background color, like so

     

    8. You can also change the gradient overlay color to match your desired theme:

     

    9. Finally, add your company logo, slogan, etc. to add branding to your form.

     

    10. That's it! You can just save the file as an image and add it to your form.

    You should now have a very neat header for use in all your forms. Enjoy!

  • Show unique rows in a secondary repeating data source table - no code!

    When designing an InfoPath form that integrates with a secondary data source such as a SharePoint list, data retrieved from SQL, or a simple XML document – you may find yourself needing to hide rows that have the same value/s as that in your main data source.

    There might already be written blogs out there demonstrating techniques on how to do this such as Greg’s and Matt’s – both show different techniques on how to filter a dropdown list showing only unique selections; but I haven’t been able to find an exact article on how to hide the entire row in a repeating table coming from my secondary data source itself.

    In a recent project, I’ve used a technique that does just this and it really is so simple so it might be worth a share. Oh, and take note --- this works like a charm using just one conditional formatting, no code at all! Interested? Follow along…

    To simulate the scenario, let’s create an XML document that lists some fruits:

    <?xml version="1.0" encoding="UTF-8"?>

    <items>
        <item>Apple</item>
        <item>Banana</item>
        <item>Orange</item>
        <item>Lemon</item>
        <item>Kiwi</item>
    </items>

    We’ll use this as our secondary data source. Save it as an XML file.

    We’ll then design a simple InfoPath form template, adding the XML file as a secondary receive data connection that automatically retrieves data on form open – we’ll call it “Fruits”.

    image

    This should be displayed in the Fields task pane like so:

    image

    And then we’ll add the main data source:

    image

    Next, drag the main data source Item group as a repeating table on the canvas, as well as the item repeating group from the XML secondary data source – add headings to differentiate the two sources, like so:

    image

    We’ll now add the key ingredient!

    First, select the item repeating group from Fruits (Secondary) data source – this is where we’ll add the conditional formatting. Display the Rules by clicking Manage Rules under the Home tab and once displayed, click New > Formatting.

    On the Condition window, leave the first and the second dropdown selections to the item field of the Fruits (Secondary) data source and as “is equal to”, respectively; then on the third dropdown, choose “Select a field or group…”

    SNAGHTML11c3da06

    Select the Fruit field from the main data source.

    image

    Click OK as many times needed to close all dialog boxes and then check the Hide this control box. Your conditional formatting rule should look similar to this:

    image

    And now, the fun part – testing your form! On preview mode, it should look like this:

    image

    Begin inserting item/s in the main data source and see for yourself, how simple it is to hide those secondary data source rows that has matching values in the main data source!

    image

    Have I mentioned it’s simple? Smile

  • How to Create a Digital Certificate and Publish a Signed Template to the DBXL Admin Tool

    Because InfoPath 2010 digital certificates are only good for a month, we will use the Digital Certificate for VBA Projects tool to create one that will last several years. You could also use InfoPath 2007 or 2003 (if available) as these both produce digital certificates that last many years. Your safest route for production is to get your digital certificate from a Certificate Authority.

    Create a Digital Certificate

    To create a digital certificate:

    1.       Open the Windows Start Menu.

    2.       Navigate to All Programs | Microsoft Office | Microsoft Office Tools.

    3.       Click Digital Certificate for VBA Projects.

    4.       In the Create Digital Certificate dialog box, type InfoPath Certificate, and then click OK.

    clip_image001

    Publish a Signed Template to the DBXL Admin Tool

    Publish an unsigned template using the following steps:

    1.       Publish an unsigned template from the InfoPath designer (we’ll sign it at a later step).

    2.       Launch the DBXL Admin Tool (DAT).

    3.       Create or edit the Document Type Configuration for your template.

    4.       Attach your InfoPath template, and ensure to clear the check box labeled Form Template Is Signed.

    clip_image002

    5.       Save your Document Type.

    6.       Click OK when the Changes Saved message appears.

    Save and sign your template using the following steps:

    1.       Right-click the saved XSN file and choose Save As.
    NOTE: Be sure the file extension is present (i.e. it you should be saving “My InfoPath Template.xsn” and not “My InfoPath Template”).

    2.       Choose a location to save your unsigned published template, and then click Save.

    3.       Locate and right-click your saved form, and choose Design.

    4.       On the File tab, click Form Options.

    clip_image003

    5.       Select Security And Trust in the Category list.

    6.       Clear the check box labeled Automatically Determine Security Level, and then choose Full Trust.

    7.       Select the check box labeled Sign This Form Template, and then click Select Certificate.

    8.       Select the InfoPath Certificate you created earlier, and then click OK.

    clip_image005 

    9.       Click OK.

    10.   Save (not publish) your signed form (overwrite previous template or save as with new name).

    Republish your signed form using the following steps:

    1.       In the DAT, you should still be editing your Document Type.

    2.       Right-click the XSN File, and choose Attach.

    3.       Locate and select your signed template, and then click Open.

    4.       Select the check box labeled Form Template Is Signed.

    5.       Click Save.

    clip_image006 

    Install the Digital Certificate

    A. If you are the user who created this digital certificate and this is the first time you are opening a form template that uses it:

    1.       Click the green-arrow download button to launch the form template.

    2.       If prompted, click Open:

    clip_image007

    3.       When presented with the certificate dialog, click Trust All Documents From This Publisher.

    clip_image008

     

    B. If you are a user other than the one who created the digital certificate and this is the first time you are opening a form template that uses it:

    1.       Open the form from the DAT (not the DBXL Dashboard).

    2.       If prompted, click Open:

    clip_image007[1]

    3.       When presented with the certificate dialog, the Trust All Documents From This Publisher button is grayed out. Click the Show Signature Details link.

    clip_image009

    4.       On the Digital Signature Details dialog box, click View Certificate.

    5.       On the Certificate dialog box, click Install Certificate.

    6.       In the Certificate Import Wizard, click Next.

    7.       Select Place All Certificates In The Following Store, click Browse, select Trusted Root Certification Authorities, and then click OK.

    clip_image010

    8.       Click Next, and then click Finish. 

    9.       On the Security Warning dialog box, click Yes, and then click OK to the successful import message.

    clip_image011

    10.   Click OK, then OK, and then click Open.

    11.   Now close the InfoPath form template and reopen it. You will once again be presented with the InfoPath Editor Security Notice, but this time click Trust All Documents From This Publisher.

    clip_image012

  • How to Use Report Builder to Build Queries and Retrieve Data from DBXL

    “Would you like to create detailed reports from your XML data without going to the trouble of creating a database mapping? With DBXL v2.5 and Report Builder, now you can.”

    In this blog post, I’ll detail the steps on how to do simple XML reporting in your forms, using DBXL’s QueryDocumentsNodeSet and the Report Builder tool:

            Extract data from your InfoPath forms even if you don’t have a database mapping

            Build your queries using DBXL v2.5’s Report Builder tool

            Export the results to Excel for pivoting and charting

    Publish a sample InfoPath form to DBXL

    1.       Download the sample InfoPath form template (CompanyContactInfo.xsn) – this is a simple InfoPath form that has a few fields and allows submit to DBXL via the SubmitDocument operation.

    2.       Open the form template in InfoPath Designer.

    3.       Go to File > Save As and save the XSN locally.

    4.       Launch the DBXL Administration Tool (DAT) from your local Database Accelerator Control Panel (the access URL would typically be in the format http://localhost:8000/QdabraWebService/default.htm).

    5.       Create a new document type configuration – give it a descriptive name and then attach your XSN. When done, click Save.

    image

    6.       Click on the Open link to open a new form using the template. Fill out and submit at least three to four documents.

    image

    Build your queries using the Report Builder tool

    7.       Download the Report Builder tool via this link.

    8.       To install, first make sure that InfoPath is not running (close all active InfoPath windows); run a command prompt as an administrator, change the directory to the location of your installation files, and then execute install.js

    image

    9.       Launch the tool by opening InfoPath, clicking New and selecting Qdabra Report Builder listed under the Installed Forms section.

    image

    10.   In the General section of the Report Builder tool, enter the Web Service URL Prefix, e.g. http://localhost:8000.

    11.   Enter QdabraWebService as the Web Service Name and then click Connect.

    image

    12.   Start building your query by clicking Add Query > Create in the Queries table.

    image

    13.   Select the document type you created in Step 5.

    image

    14.   Click on the Schema icon (image) – this will display the custom task pane at the right, double-click on the root node which in our sample XSN is  /my:myFields.

    15.   Click Insert Item and start adding the fields you wish to retrieve. Give each field an alias which will be the label/title in the Excel report for that particular field/column. Note that we can’t use spaces in aliases.

    image

    Notice the Query XML section – here, you’ll see the query string we’ll be using to retrieve the data using DBXL web service QueryDocumentsNodeSet operation later on. Copy this string and paste it in Notepad for now.

    16.   Click Perform Query – you’ll be taken to the Query All tab, click on the left arrow key (image) to expand and see the query result, like such:

    image

    You can click on the Export All Queries to Excel should you wish to use the data in Excel and do reporting.

    image

    Use QueryDocumentsNodeSet to auto-populate dropdowns

    We can now use the DBXL’s web service method called QueryDocumentsNodeSet to retrieve data in a form from another form.

    17.   In InfoPath Designer, create a new blank form.

    18.   Go to Data > Data Connections > Add and add a data connection that retrieves data from a SOAP Web service.

    19.   The URL to the DBXL Document Service would be in the format: http://<DBXLServer>/QdabraWebService/DbxlDocumentService.asmx, where <DBXLServer> is the machine where DBXL is installed (in this case, your local machine):

    image

    20.   Select QueryDocumentsNodeSet from the list of operations.

    image

    21.   Set Sample Value of the tns:query parameter to the query string generated by Report Builder – remember that you’ve pasted this in Notepad earlier.

    image

    22.   Click Next twice; give the data connection a descriptive name and then uncheck the box ‘Automatically retrieve data when form is opened’.

    image

    23.   Click Finish > Close to exit out of the Data Connections wizard.

    24.   In the Fields task pane, add a new field called Company – display this on the canvas in a dropdown list box control, like so:

    image

    25.   Right-click on the dropdown and select Drop-Down List Box Properties.

    26.   Change the List box choices selection to Get choices from an external data source. The data source will default to the one you just added.

    27.   Click on the icon next to Entries and then expand the nodes until you see the Company node – select that.

    image

    28.   You might want to check the box ‘Show only entries with unique display names’ in case you have multiple entries with the same value.

    image

    29.   Next, we’ll add form load rules that first sets the query string and then queries the data connection.

    a.       From the InfoPath Designer menu, go to Data > Form Load

    image

    b.      In the Rules task pane that appears, click New > Action > Add > Set a field’s value.

    c.       Allow the action to set the query parameter of the QueryCompanies secondary data source, to the query string generated by the Report Builder (again, you pasted this in Notepad).

    image

    d.      Add another action in the same rule that queries for data in the QueryCompanies data connection.

    image

    30.   Preview your form template – your dropdown should auto-populate with data from your DBXL doctype:

    image

    There’s your form data from another form – no database queries/mapping involved!

  • Make that repeating group display two rows per item instead of just one!

    The default Expense Report form that’s shipped with InfoPath 2007 makes use of a table that shows the expense item details per row. Your requirement is to add a new field where users can enter notes or comments for that particular expense item – you’d like to display this new field underneath the already-existing row in the table, therefore having 2 rows for each item now.

    The technique used in this blog doesn’t only apply to the Expense Report form but to all others where you’d want to show two rows per item in a repeating group, instead of just one.

    Adding a new field is easy:

    1. In your main data source, locate the items group > item repeating group and add a new field called notes (you can set it either as Text (string) data type or a Rich Text (XHTML) depending on your requirement).

     

    Your main data source should look similar to this:


    The tricky part is the layout – displaying the controls in two separate rows, and making the header/footer not repeat like how it is in a repeating table.

    To achieve the layout we want, we need to skip using a repeating table and use a repeating section instead. Follow along…

    2. Place your cursor where you want to display the section on the canvas - the Itemized Expenses layout table would probably be your pick. Don’t delete the existing repeating table just yet so you can copy/paste or drag/drop some items over later.

    3. In the Data Source taskpane, right-click on the items parent group and select Section – this will insert a section right where your cursor is on the canvas. Set this section’s padding to 0px to get rid of the unnecessary white spaces inside the section and that all its contents will stay as close to the edges as possible.


    4. With your cursor placed inside the newly-added section, go to the Table menu > Insert > Layout Table… and insert a 5 columns by 3 rows table.

    You may specify the number of columns you want depending on the fields you want to display. We’re adding 3 rows however, so we’ll have the top row for our table header, 2nd row for the repeating section that will hold the expense item details (so merge the cells to make it 1 whole row without columns), and the 3rd for the total amount of the expenses.

     

    5. Place your cursor in the second row (the one you just merged) and again, set all the paddings to 0px.


    6. Without moving your cursor where it’s at, right-click on the items repeating group and then select Repeating Section. This time, set all its paddings and margins to 0px.

     

    In InfoPath 2007, sections and repeating sections have some kind of invisible borders by default. Remove this by selecting the repeating section, and selecting None in the Borders and Shading dialog.


    Again, we’re doing all this to eliminate all the white spaces as possible in order to achieve that all-in-the-same table effect (like what a repeating table would give) even though we’re using a repeating section.

    7. With your cursor still inside the repeating section, insert a 5 columns by 2 rows table. The 1st row will hold the default details (Date, Description, Category, Cost and the arrow button) while the second is for the new notes field.

    8. Add the controls inside the table (you can drag and drop from the existing repeating table and delete it afterwards).

    Adjust the formatting to your liking – resize the cells making sure that all the columns and rows are perfectly aligned, fix the paddings and margins, add borders/shading, etc.

    Your layout might look similar to this:


    And in Preview, something like this isn’t bad at all:


    Have fun! :)

  • qRules: Videos and Documentation Links

  • New! qRules v2.4 Form Flags Sample Form

     The qRules Form Flags sample form features the following qRules Commands:

    • IsNew - checks if form is new and sets the form version to '0'. This form version increments as changes are made to the form.
    • IsDirty - checks if the form has changed. If there are no changes and user clicks Save/Submit, the form will not save/submit to the server.
    • SetDirty - resets the IsDirty flag to 'false' on successful submit to allow further changes the next time the form is opened.
    • IsReadOnly - checks if the form is currently opened by another user and prevents save/submit if so.
    • ClearErrors - clears validation errors to allow users to save the form regardless if the required fields have been completed or not.
    • GetErrorCount - counts the number of validation errors in the form; if present, users will not be allowed to submit.
    • SetCaption - sets the form title to the form's name in the SharePoint library.
    • SetSave - prevents File > Save to the SharePoint library.
    • Bonus:
      • Checks if a newer version exists on the server.
      • Detects the form status (Saved/Submitted), version and DocID which are all displayed on the form's footer.
    Click here to download the sample form.
  • Free Training: Using InfoPath Workflow

    You may be familiar with SharePoint workflow, but have you added workflow to an InfoPath template? InfoPath workflow is easier to use because it's handled in InfoPath instead of requiring the user to complete certain actions in SharePoint.

    Users can easily see the state of the form and you can add custom conditional viewing to switch views based on the user role (e.g. a private Comments section in a Manager's view).

    During this lab, you will modify a Timesheet form template to pull user information from Active Directory, submit to SharePoint, and pass the SharePoint link in the notification email.

    Retrieving the Users' Active Directory Information

    If you go to Data > Data Connections, you'll see the pre-configured data connections that use Qdabra DBXL's Active Directory Web Service methods to retrieve the users' information.

    And if you go to Data > Form Load, you will see a rule that populates the user info:

    We're basically setting the fields in our form to the values retrieved from the Active Directory web service methods and using filters to specify which Key to use.

    Add the Submit Data Connections

    Start by modifying the starter template to add data connections that submit the form to SharePoint and through email.

    1.       Open the Starter Template XSN (included in this lab) in InfoPath Designer.

    2.       Save the template on your local machine by going to File > Save As and saving it with the name Timesheet.xsn

    3.       Add the data connection to submit to your SharePoint library.

    a.    Go to Data > Data Connections > Add > Create a new connection to submit data > To a document library on a SharePoint site

    b.    Enter the name of your document library, such as http://training.qdabra.com/personal/<<username>>/

    c.    For the File Name, click on the fx button and insert the formula:

    concat(tc:week/tc:weekOf, " - ", tc:employee/tc:name/tc:singleName)

    If you click on the Verify Formula button, you should see the following:

    d.    Click OK in the Insert Formula dialog.

    e.    Check the box ‘Allow overwrite if the file exists'.

    f.    Click Next, leave the default data connection name, and then click Finish.

    4.       Add an email submit data connection.

    a.    In the Data Connections dialog, click Add > Create a new connection to submit data > As an email message

    b.    Click on the fx button next to the To field and select the emailto field which you'll find under the my:actions group in the main data source.

    c.    Click on the fx button next to the Subject field and enter the formula:

    concat("Time Card: ", tc:week/tc:weekOf, " - ", tc:employee/tc:name/tc:singleName, " has been ", my:actions/my:status, " by ", my:actions/my:modifiedby, ".")

    If you click on the Verify Formula button, you should see the following:

    d.    Click OK in the Insert Formula dialog and then click Next.

    e.    Make sure that the option ‘Send only the active view of the form and no attachment' is selected.

    f.    Click Next, leave the default data connection name, and then click Finish.

    5.       Click Close to exit out of the Data Connections wizard.

    Add the Rules that Trigger the workFlow

    In the Employee (default) view, you'll see a Submit button. This button will have rules that will set the form fields' values that are being used in the workflow, such as who modified the form, whom is it assigned to after the form submits, which email address should it be sent to, etc. Same goes for the Approve and the Reject buttons which you'll find in the Manager view - they have rules that trigger the workflow.

    Since the form also has a Form History section for tracking purposes, you may find other rules that set the history data. These have already been added in the form so we can concentrate on implementing the logic that is associated with the workflow.

    Start by modifying the Submit button:

    6.       In the Employee view, click on the Submit button.

    7.       From the Home tab > Rules section, click Manage Rules to display the Rules taskpane.

    You will see the following pre-configured rules:

    8.       Add a rule that sets the metadata

    a.    In the Rules taskpane, click New > Action.

    b.    Name your rule ‘Set Metadata'.

    c.    Move the rule up so that it's the third in the set, i.e. after the rule ‘Warn: Need Hours'.

    d.    Set the modifiedby field:

    i.    Click Add > Set a field's value.

    ii.    For the field, select modifiedby under the my:actions group:

    iii.    For the value, click on the fx button and select singlename under employee > name

    You can also just enter the following XPath in the Insert Formula dialog: tc:employee/tc:name/tc:singleName

    iv.    Click OK to close the dialogs.

    e.    Set the assignedto field:

    i.    Click Add > Set a field's value.

    ii.    For the field, select assignedto under the my:actions group.

    iii.    For the value, click on the fx button and select singlename under employee > name.

    iv.    Click OK to close the dialogs.

    f.    Set the emailto field:

    i.    Click Add > Set a field's value.

    ii.    For the field, select emailto under the my:actions group.

    iii.    For the value, click on the fx button and select emailAddressPrimary under company > contact. You can also just enter the following XPath in the Insert Formula dialog: tc:company/tc:contact/tc:emailAddressPrimary

    iv.    Click OK to close the dialogs.

    g.    Set the status field:

    i.    Click Add > Set a field's value.

    ii.    For the field, select status under the my:actions group.

    iii.    For the value, enter the text Submitted

    iv.    Click OK.

    h.    Set the notes field:

    i.    Click Add > Set a field's value.

    ii.    For the field, select notes under the my:actions group.

    iii.    For the value, enter the text Submitted to Manager

    iv.    Click OK.

    You should now have the following Submit button rules that set the metadata:

    9.       Add a rule that submits the form:

    a.    Click New > Action.

    b.    Name your rule ‘Submit' - this will be the last rule in the set.

    c.    Submit to SharePoint:

    i.    Click Add > Submit data.

    ii.    Select your SharePoint Library submit data connection from the drop-down:

    iii.    Click OK.

    d.    Set the done field:

    i.    Click Add > Set a field's value.

    ii.    For the field, select done under the my:actions group.

    iii.    For the value, enter 1

    iv.    Click OK.

    Notice the conditional formatting in the Submit button:

    This means that we want the Submit button to be disabled if the value of the done field equals "1" which we set after the form submits to SharePoint. This will prevent users from clicking on the Submit button twice which may result to double-submits.

    e.    Submit via email:

    i.    Click Add > Submit data.

    ii.    Select your email submit data connection from the drop-down.

    iii.    Click OK.

    f.    Close the form:

    i.    Click Add > Close the form.

    ii.    Uncheck the box ‘If changes have not been saved, prompt the user to save.

    iii.    Click OK.

    You should now have the following Submit button rules that submit the form:

    Next, we will add rules in the Approve button:

    10.    Go to the Page Design tab and switch to the Manager view.

    11.    In the Manager view, click on the Approve button. You will see the following pre-configured rules:

    12.    Add a rule that sets the metadata.

    a.    In the Rules taskpane, click New > Action.

    b.    Name your rule ‘Set Metadata'.

    c.    Move the rule up so that it's the second in the set, i.e. after the rule ‘Warn: Need Notes'.

    d.    Add the following actions:

    13.    Add a rule that submits the form:

    a.    Click New > Action.

    b.    Name your rule ‘Submit' - this will be the last rule in the set.

    c.    Add the following actions:

    Finally, we'll add rules for the Reject button:

    14.    In the Manager view, click on the Reject button.

    15.    Add the same ‘Set Metadata' rule that runs after the ‘Warn:Need Notes' rule.

    16.    Add the following actions:

    17.    Add a Submit rule which is the last in the set, and then add the following actions:

    18. Save your changes to your XSN.

    Create the Form Link

    We will add a hyperlink control that links to the form in SharePoint. The link will be included in the notification email so that users can click on it to open the form.

    19.    In the Manager view, you'll see a small section at the bottom. Place your cursor below the label ‘Click here to open this time card:'

    20.    Go to the Insert tab and click Hyperlink.

    21.    In the Insert Hyperlink dialog, change the Link to and the Display options to Data Source.

    22.    Insert the formula:

    concat(substring-before(substring-after(/processing-instruction()[local-name() = "mso-infoPathSolution"], 'href="'), "/Forms/"), "/", tc:week/tc:weekOf, " - ", tc:employee/tc:name/tc:singleName, ".xml")

    The formula is a concatenation of the form location in SharePoint, e.g. http://<YourSharePointSite>/<YourSharePointLibrary>/<FormFileName.xml>

    Recall that we've set the form file name to this formula on SharePoint submit:

    Publish the Template to your SharePoint Library

    In order to access the form template and submit forms, you need to publish it to a location where users can access it from, such as a SharePoint form library.

    23.    Go to File > Publish and then select SharePoint Server.

    24.    Enter the URL to your SharePoint site.

    25.    Leave the default to Form Library and then click Next.

    26.    Select ‘Update existing form library' and select the SharePoint library you created earlier - that is, where you've set your forms to submit to.

    27.    Click click Next twice, click Publish, and then click Close.

    Test by submitting a new Timesheet form assigning it to your manager. Your manager will receive the form via email and will see a link where to access the form.

    The manager will then open the form via the link and will decide whether to approve or reject. Approving goes to HR and rejecting goes back to the original submitter.

More Posts Next page »
Copyright © 2003-2017 Qdabra Software. All rights reserved.
View our Terms of Use.