A frequent question from InfoPath users is “How can I pass parameters to a new InfoPath form when it is created?”

Unfortunately, there’s no built-in functionality for passing command-line parameters to infopath.exe.

BUT, that doesn’t mean it can’t be done J

Note that the solution below requires the InfoPath SP-1 Preview.

Solution:

Jscript files can instantiate InfoPath with a new form from a template using NewFromSolution().  Jscript can also access the InfoPath DOM and pass parameters to it.  And finally, Jscript files can also accept command-line parameters.

Usage: 

In my case, I wanted my C# application to pass parameters to a new Form.  Basically, the user (running my App) searches the SQL database for a customer (in my case, patient) account.  They can then view/edit all of that account’s data right in the app.  The user can then select a date and time for an appointment and click “Create Encounter.”  This button calls my jscript file, passing it the ID number, date, and time that were selected.  The Jscript file creates a new InfoPath form from the template, and fills in the ID number, date, and time.  The Form Template has the “AfterChange” event for the ID number text box set so that it queries the database with that ID number, which returns that customer/patient’s information and populates all relevant fields in the Form.  It then closes InfoPath, and my application simply says “Encounter file created.”

The form’s submit code puts it in a SharePoint library with a unique filename generated from the ID number and date/time of the appointment.

Calling the script:

In VB .NET, this is a simple matter of:

The Script:

This is a ready-to-go script file and all you need to change is A) The number of parameters B) The location of your template and C) The names of the fields you wish to populate.  You also may not want to submit the file or close InfoPath.  Or you may want to use oXDocument.SaveAs();

转自:http://geekswithblogs.net/bpaddock/archive/2004/05/14/4907.aspx

转载于:https://www.cnblogs.com/Dragon-China/archive/2007/12/14/994509.html

InfoPath: Passing Command Line parameters to a new form相关推荐

  1. TexturePacker命令行使用(command line)

    TexturePacker是一个非常好用的小图合并工具,介绍它的文章非常多,多数都是使用GUI工具的,但是: 如果原始图片发生了改变,我们就需要重新手动拼接一下,麻烦. 使用GUI界面非常不高端,我高 ...

  2. 【413】C 语言 Command line

    Command-Line Arguments All the executable programs above have a main(void) program more generally, e ...

  3. 实验记录 | mutect问题详解:No tribble type was provided on the command line and the type of the file?

    出错详情: /home/xxzhang/workplace/software/java/jdk1.7.0_80/bin/java -Djava.io.tmpdir=./output_RNA/mutmp ...

  4. mysql客户端指令_mysql command line client(mysql命令行客户端)

    mysql command line client(mysql命令行客户端) (2010-03-24 09:18:38) 标签: 文化 分类: 数据库 1.输入密码:****** 2.ues mysq ...

  5. mysql command line闪退_MySQL Command Line Client 打不开(闪退)的解决

    网上搜索到的解决办法: 1.找到mysql安装目录下的bin目录路径. 2.打开cmd,进入到bin目录的路径下,输入mysql -u root -p. 问题分析: 1.查看mysql command ...

  6. MySQL中MySQL X.X Command Line Client一闪而过的问题

    问题介绍:我安装完MySQL(我安装的是5.5)后,使用MySQL 5.5 Command Line Client,每次点击,总是一闪而过.解决方法如下: 首先进入cmd 切入MySQL的安装目录,然 ...

  7. MySQL 5.6 Warning - Using a password on the command line interface can be insecur 解决方案

    MySQL 5.6 Warning - Using a password on the command line interface can be insecur 解决方案 参考文章: (1)MySQ ...

  8. ERROR MESSAGE: Invalid command line: Malformed walker argument: Could not find walker with name

    介绍和分析 我是用的环境是 GATK v3.7-0-gcfedb67 的 GenomeAnalysisTK.jar Java环境为: > java -version openjdk versio ...

  9. mac mysql本地连接数_如何用command line链接mysql

    #代码生活 小红书的宝宝们大家好,我现在是卧龙岗大学的一名IT新生啦.这两天呢就在准备开学的相关事宜.那有一个很大的事情就是软件安装! 虽然mac系统被各大编程教程鄙视,但是只要我的教程搜索够快,那些 ...

最新文章

  1. 如何在Windows中安装Python?
  2. iOS架构-cocoaPods之自制私有库及管理(17)
  3. 奇怪,不能上GOOGLE了...你们也是这样吗?
  4. Intervals on the Ring 环状数轴区间-模数-构造-区间交并集
  5. php中pandans,Python地信专题 | 基于geopandas的空间数据分析-文件IO篇
  6. Ajax同步交互与异步交互
  7. 安卓学习笔记07:事件处理、窗口跳转与传递数据
  8. 算法图解学习笔记02之选择排序
  9. 6)Thymelead th:with 局部变量 与 属性优先级 和 Thymeleaf 注释
  10. 关于指针函数以及函数指针的一些理解
  11. 从0开始搭建微信小程序(前后端)的全过程
  12. 大数据点点滴滴积少成多---进阶之路
  13. TFT-lcd液晶屏接口类型之ttl接口
  14. [Maven]intellij 如何使用mvn clean
  15. eBPF系列学习(4)了解libbpf、CO-RE (Compile Once – Run Everywhe) | 使用go开发ebpf程序(云原生利器cilium ebpf )
  16. R语言学习(常用)网址和书籍
  17. 关于能连上网却打不开网页的问题
  18. 服务器普通硬盘,服务器硬盘和普通硬盘区别
  19. 李峋 爱心代码 点燃我温暖我
  20. LeetCode 417. 太平洋大西洋水流问题--BFS

热门文章

  1. 区块链软件开发:区块链+餐饮
  2. 部署 SaltStack 自动化运维工具,并简易批量安装 httpd 服务
  3. 七个你一定会犯的云安全错误
  4. 《游戏大师Chris Crawford谈互动叙事》一1.1 故事叙述的历史
  5. [NHibernate]集合类(Collections)映射
  6. 64位 eclipse完美安装svn插件
  7. 同林多域共用一台Exchange
  8. Castle ActiveRecord学习实践(7):使用HQL查询
  9. 12、常见Conditional注解源码解析-ConditionalOnClass
  10. mysql jsp分页技术_一个非常简单的分页技术MYSQL JSP 利用了mysql的LIMIT参数