InfoPath – Confirm and Close

One glaring shortcoming of InfoPath is an option that allows you to tell InfoPath to close after a form is submitted. There is the option to close the form, but not close the application. So, here’s the code to make it happen.

Put this in the Code of a Submit button.

Note: Be sure to leave the function CTRL19_5::OnClick(eventObj) (your CTRL number will be different) line alone and place the following between the two {}:

if (XDocument.Errors.Count > 0) 
{
XDocument.UI.Alert("Required information is missing as indicated by the red asterisk(s).") ; 
return; 
} 
try 
{ XDocument.Submit() Application.ActiveWindow.Close(true); } 
catch(e) 
{ XDocument.UI.Alert(e.description); }

The first part of the code checks to see if there are any required fields that have no value. If there are, the text displayed in teal is presented to the user and control returns to InfoPath. If no errors are found, the Submit is attempted. If an error or another kinds is found, the error message is displayed. Be sure to turn on Submit options in the Forms Options dialog.

InfoPath – Introduction

The most amazing tool in the Microsoft Office 2003 suite, in my humble opinion. InfoPath is a tool to use to create cool automated forms.

I’m not a developer. I don’t know .NET, Javascript, or any other programming language. I’m just a process junkie who likes to put these tools to work to help me do my job more efficiently and economically.

InfoPath, in its 2003 incarnation, made great strides in giving forms authors flexibility and control.

  1. Design a form. Use all sorts of cool buttons, controls, and other UI elements.
  2. Define data connections. Data connections are the conduits through which the data in your forms gets submitted to someone or something. You can connect to Sharepoint forms libraries, Web services, or other databases. I don’t work much with Web services because, like I said, I’m not a developer and haven’t had access to the administrator console.
  3. Provide Submit buttons to allow users to send forms to:
  • Users via email (one or many)
  • Sharepoint lists so you can keep track of the forms, requests, or whatever animal you create.

The Help system in InfoPath is abysmal at best. The InfoPath Microsoft Newsgroup is very helpful.

Madcap Flare – Providing a URL to a Specific Topic

Sometimes you may need to allow users to link to a specific topic within your Flare system from an external source. This can be done using two elements required by a context-sensitive help system known as a Header and an Alias file. You don’ t need to know a lot about them, just follow the instructions below.

Create the Header and Alias Files

From the Project Organizer, expand the Advanced folder. If there is a header and an alias file, skip to step 9; otherwise, begin here:

  1. Click Project…Advanced.
  2. Select Add Header File.
  3. In the File name field enter the word header.
  4. Click the Add button.
  5. Click Project…Advanced.
  6. Select Add Alias File.
  7. In the File name field enter the word alias.
  8. Click the Add button.

Create an Alias for each Topic

Each topic you would like to provide a link for will need an Alias.

  1. From the Project Organizer, expand the Advanced folder.
  2. Double-click the alias file. The Alias editor opens.
  3. Under the Identifier column click CHANGE_THIS.
  4. Enter the name for the Alias. This is the name that will become part of the URL. It can be anything, but its a good idea to keep it short and sweet.
  5. From the Topics pane on the right, select the topic you’re creating the alias for.
  6. Click the Assign button. Notice the path of the topic appeared in the Topic column.
  7. Repeat steps 1 thru 6 for each topic for which you need a URL by clicking the New Identifier button in place of step 3 above.

And the URL is . . .

yourprojectpath/default_csh.html#aliasname

Replace yourprojectpath with the path to your project. Replace aliasname with the name of the alias from step 4 above.

The key is that you’re launching default_csh.html rather than default.html, which is the normal file to load a Flare project. The _csh string indicates Context Sensitive Help — remember that from the beginning of the lesson? You may want to learn about context sensitive help if you’re not already familiar with it, but you don’t need to know a thing about it for this exercise.

The other key thing to note is the # between the filename and the aliasname. That’s important.

Also, you could add a | symbol to have the topic launched in a different skin. Using the same example:

yourprojectpath/default_csh.html#aliasname|skin

 

Madcap Flare – List Tips

Change <li> to <P> while staying in the list

Oftentimes within a list you might want to add a paragraph to an existing list item without creating the next iteration of the list item. Pressing <enter> gives you the next iteration. Here’s how to convert it to a paragraph:

  1. Create the new paragraph by pressing Enter.
  2. Hover over the <li> tag in the Show BlocksIf the Show Blocks pane is not visible, click the Show Blocks button from the topic toolbar. pane on the left until your pointer changes to a pointing hand.
  3. Right-click and select Mark as Paragraph. This will create a <p> tag. Unfortunately, the <li> tag is still there so the item has the list graphic (or number, if an ordered list).
  4. To get rid of the list graphic, go to the end of the previous line and press the Delete key.

Leave <li> and change to <P>

You can end a list by simply pressing Shift+Tab.

Madcap Flare – Cross References

Cross references are the preferred type of navigation link to be used when generating Word output, since they are the only type that is converted to a useful format.

To change the language that precedes a cross-reference in printed output

  1. Open styles.css in the Stylesheet Editor.
  2. Scroll down to and select the xref style.
  3. Buried in the most unobvious location is a feature to change the language. Click in the second cell of the mc-format row. The Cross-Reference Format dialog magically appears. Who would have thunk it?
  4. In the white text box below the Enter format {preview below} box, replace “See” with something more friendly to the Word reader, like:

See on page {para}

The {para} string will automatically be converted to the appropriate page number upon generation.

Madcap Flare – Conditional Text

Controlling What’s Included/Excluded in Your Output

Facts to know:

  1. In WebHelp or HTMLHelp a topic can show up even though it’s not in the Table of Contents. How? During target generation, Flare processes the topic’s Conditional Text settings from the Content Explorer first. If the topic makes that first cut, it is included in the output and all search results. Flare then processes the Conditional Text settings of the topic’s shortcut in the Table of Contents. If it makes that cut, the topic also appears in the Table of Contents. If it doesn’t, it’s still included in the Search results.
  2. A topic ‘s Conditional Text settings can be different between the Content Explorer and the shortcut to the topic in the Table of Contents.
  3. A topic’s Conditional Text settings in the Content Explorer DO NOT automatically become part of the topic’s shortcut in the Table of Contents. You must set them separately in the Table of Contents.
  4. If a topic’s Conditional Text from the Content Explorer has ANY matching Conditional Text to be INCLUDED in the target, it will show up in search results, even if there are matching EXCLUDES, as INCLUDE takes precedence.
  5. Be careful with many Conditional Text items. Conditional Text does not support nesting. If there are any matching INCLUDES, it’s INCLUDED. There needs to be one controlling Conditional Text item per target.