InfoPain and Beyond

38
InfoPain and Beyond Tricks to ease the Infopath Drudgery Stephan Onisick

description

Basic Presentation of InfoPath 2007 and Common Aggravation

Transcript of InfoPain and Beyond

  • 1. Tricks to ease the Infopath Drudgery Stephan Onisick

2. Dirty Dog or Heroine: Gin Gin 3. PresenterStephan Onisick, MCSD,MCDBA,MCTS, CTT+SharePoint Developer for Phacil(Contractor for Missile Defense Agency)InfoPath Developer for last 18 months blog: www.infopathpainmanagement.com email: [email protected] Projects include Meeting Scheduling Application for Management Include Creating Outlook Meeting Requests Digital Signatures Visual Studio Workflow BackendAnnouncement Approval System InfoPath Managed Code to manage view for SharePoint Groups Secondary Connections to handle Email to Recipients Extensive use of Data Form Web Parts to Manage Permissions and Views 4. Audience Experience with Infopath Notice any headaches, nausea when working on certain InfoPath Forms? 5. Audience Experience with InfoPath(more seriouslyshow of hands please) How many have developed forms in InfoPath? How many are using predominantly Client-Side InfoPath?(Meaning from an InfoPath Office Application verses from abrowser on a SharePoint.) How many have worked with InfoPath in conjunction withWorkflows or Event Receivers? How many have worked with InfoPath Managed Code?**Essentially InfoPath Managed Code is an InfoPath Formassociated with a Visual Studio Program Project. 6. Presentation Overview1. What is InfoPath?2. Why InfoPath Anyway?3. InfoQuirks4. Techniques to Ease the Pain 7. What is InfoPath? InfoPath is a Microsoft Product used to develop data-entry forms based on XML. It encompasses bothClient and Server-Side technology to create andprocess forms.(kind of a forms processor and form-processing venue)**InfoPath is a valuable component in integrated SharePoint Workflow systems.**As InfoPath integrates more into SharePoint Lists in SharePoint 2010 I believe mining XML data will become less importantmore emphasis will be on promoted variables.**InfoPath is not a four-letter wordOk sometimes it is. 8. Why InfoPath Anyway? Built into the core of SharePoint Examples Document Information Panels Workflow Association or Initiation Forms Even More Prevalent in SharePoint 2010 List Screens can be customized by InfoPath Almost the Only Game in Town Possible Alternatives 9. Why InfoPath Anyway?Document Image Panel: 10. Why InfoPath Anyway?Workflow Association or Initiation Forms: 11. Why InfoPath Anyway?SharePoint 2010 Provides the ability to customize : Customize list forms with InfoPath 2010: Friday CoolContent**Brings up an interesting point: How many have had tochoose between a List and a Form Library for a givenproject. In SharePoint 2010 you can use a simpler touse List and have the ability to customize the entry,edit and delete screens. (best of both worlds) 12. Why InfoPath Anyway?Alternatives: iTechnology Forms Accelerator 13. Why InfoPath Anyway?Alternatives: Open Source Free Form 14. Why InfoPath Anyway?Alternatives: Possibly Telerik Controls for SharePoint 15. InfoQuirks1.Controls with Dissimilar Common Properties.2.Different Behavior in Preview Mode from Published Templates.3.Functionality Buried within the Menu Structure4.NTLM Authentication Problems with Web Services.5.Difficulty Debugging Managed Code for Browser-Enabled forms.6.Digital Signature Woes.7.Tribble Multiplication Effect on Column Mappings in FormLibraries.8. Natively, Limited Control over Parts of the Environment.9. Inability without Managed Code to return a Sorted and Filtered Viewof SharePoint List.10. Continually Changing DataSources to Move from DifferentEnvironments or Servers. 16. InfoQuirks1. Controls with Dissimilar Common Properties 17. InfoQuirks1. Controls with Dissimilar Common Properties Why dont we just use a Read-Only View and not worry about the quirks? Gotcha-- if an attachment is involved--it will not be readable. 18. InfoQuirks2. Different Behavior in Preview Mode from Published Templates. Demo Demo 19. InfoQuirks3. Functionality hidden deep in the Menu StructureTry to access the Rules. They are in many placesdepending on control or functionality desired: Open and Save under Tools=>Form Options=>Openand Save Individual Controls Rules Conditional Rules Far Right Side Panel for performing many task Access to programming in Different Places**This is greatly enhanced in InfoPath 2010 with new ribbonfunctionality 20. InfoQuirks4. Problems with Web Services with NTLM Authentication. Double-Hop Issue: An authentication issue where credentials that are needed for access to resources on a third computer, or third tier, cannot be used in the request for those resources from the second tier. In our environment, web-services were not a viable option until the authentication method changed to Kerberos. 21. InfoQuirks5. Difficulty Debugging Managed Code for Browser-Enabled forms. Find harder to debug than other Visual Studio Projects likeWorkflows or Event Receivers Had to use the physical debug statement as opposed to settinga manual breakpoint in code:System.Diagnostics.Debugger.Break() to actually get it to work.How to: Debug Browser-Enabled Forms Deployed on InfoPath Form Services **A limited amount of debugging can be done in Visual Studio in Client-side Preview Mode. 22. InfoQuirks6. Digital Signature Woes Do you really need Digital Signatures or would somekind of E-Sign functionality work (like QdabraElectronic Signature). Do you really need a digest that can be tampered withor are you just trying to reasonably verify the signer? InfoPath Active X Digital Signature Controls aretargeted to Power Users. Difficult to download in less Privileged Environments(We actually had to repackage the controls so that theycould be pushed via SMS to our environment.) Dependent on Certificate Revocation Server to handleCertificate Revocation List (we used Tumbleweed) 23. InfoQuirks7. Tribble Multiplication Effect on Column Mapping Mapping InfoPath Promoted Columns to Site Columns Column mappings to form columns can be arbitrarily changed when new InfoPath fields are inserted or deleted. This can even happen when a field name or data type is changed within a previously published form. For example, a form field named EventDate might be initially mapped to the internal name EventDate in a form library. This column might be subsequently be remapped by InfoPath to EventDate1 on re-publication. This wreaks havoc when a workflow or event receiver attached to the form is expecting specific column names. A workflow might blow up with a mysterious error or enter a section of code not dictated by your understanding of the logic. 24. InfoQuirks8. Natively, Limited Control over part of the environment. Trying programmatically resizing your Screen Allowing given controls to stay in focus Controlling the functioning of the back button Try Exiting or Redirecting within Managed Code** Through use of XMLFormView control more functionalitycan be achievedbut its not easy coding communicatingwith the Host. 25. InfoQuirks8. Natively, Limited Control over part of the environment. Trying programmatically resizing your InfoPath Screen Allowing given controls to stay in focus Controlling the functioning of the browser back button Try Exiting or Redirecting within Managed Code** Through use of XMLFormView control with or without a webpart more functionality can be achievedbut its not easycoding communicating with the Host. 26. InfoQuirks9. Inability without Managed Code to return a Sorted and Filtered View of SharePoint List. Natively, the list comes back the way it way originally input. (No filtering) 27. InfoQuirks10. Continually Changing DataSources to Move fromDifferent Environments or Servers. Changing SharePoint ServerNames and Form LibraryNames Sometimes InfoPath would change column mappings whenDataSources changedcausing problems for workflowsand event receivers. 28. Techniques to Ease the Pain1. Creating Conditional Display of Debugging in the Form.2. Saving the Form to Different Locations without Changing the Data Source. (Managed Code)3. Getting a Sorted List. (Managed Code)4. Getting a Functional Reset Button. (Managed Code)5. Utilizing A Batch Script to Upload Managed Forms. 29. Techniques to Ease the Pain1. Creating Conditional Display of Debugging in theForm. 30. Techniques to Ease the Pain1. Creating Conditional Display of Debugging in theForm. 31. Techniques to Ease the Pain2. Saving the Form to Different Locations without Changing the Data Source. (Managed Code) 32. Techniques to Ease the Pain3. Getting a Sorted List. (Managed Code) 33. Techniques to Ease the Pain4. Getting a Functional Reset Button. (Managed Code) 34. Techniques to Ease the Pain5. Utilizing A Batch Script to Upload Managed Formsprompt $D $T$_$P$Gset pathxsn="C:UsersstephanoDesktopInfoPain and BeyondTravelRequestDemoXSNTravelRequestv03.xsn"set urlpath="http://saovaio-pc"cd "C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions12bin"@echo Removing Form Template...stsadm -o deactivateformtemplate -url %urlpath% -filename %pathxsn%stsadm -o execadmsvcjobsstsadm -o removeformtemplate -filename %pathxsn%stsadm -o execadmsvcjobs@echo Adding back Form Template...stsadm -o uploadformtemplate -filename %pathxsn%stsadm -o execadmsvcjobsstsadm -o activateformtemplate -url %urlpath% -filename %pathxsn%stsadm -o execadmsvcjobs@pause