简体   繁体   English

如何确保自动填充的用户名不会被InfoPath中的另一个用户名替换

[英]How to ensure that the username that is auto-populated does not get replaced by another one in InfoPath

I have an approve and reject form having three views. 我有一个批准和拒绝形式有三个观点。 In the first view ie the requester's view I auto-populate the requester name by using "GetUserProfileByName". 在第一个视图即请求者的视图中,我使用“GetUserProfileByName”自动填充请求者名称。 Now I also want to auto populate the name of the user who approves the form in a different view (but this view also has the requester's name)- so I was wondering if I actually use "GetUserProfileByName" again won't it change the first name too (ie the requester's name). 现在我还想在不同的视图中自动填充批准表单的用户的名称(但是这个视图也有请求者的名字) - 所以我想知道我是否真的再次使用“GetUserProfileByName”它不会改变第一个也是名字(即请求者的名字)。 I don't have other accounts to test it out. 我没有其他帐户来测试它。

Can someone please provide a workaround to this problem 有人可以提供解决此问题的方法

So basically I want this to happen:- For example when John enters the form his name should be auto populated in the requester's name field. 基本上我希望这种情况发生: - 例如,当John输入表单时,他的名字应该在请求者的名字字段中自动填充。 And once this form is send to Michelle who approves it - the approver's name field should have been autopopulated with Michelle's name. 一旦这个表格被发送给批准它的米歇尔 - 批准者的名字字段应该以米歇尔的名字自动填充。

How can I avoid overwriting of data. 如何避免覆盖数据。

Thank you for helping 感谢您的帮助

Add fields to the form data source to store the data returned from GetUserProfileByName service. 将字段添加到表单数据源以存储从GetUserProfileByName服务返回的数据。 Do not use default values for the values in these fields. 请勿对这些字段中的值使用默认值。 Instead, I generally use form load rules for this - run the query, and then, if the requester field is blank, set the field to the user's name from the datasource. 相反,我通常使用表单加载规则 - 运行查询,然后,如果请求者字段为空,则将字段设置为数据源中的用户名。

When the approved view is submitted, you can take a similar approach with the approver name field - if it is blank, set it. 提交批准的视图后,您可以对批准者名称字段采取类似的方法 - 如果为空,则进行设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM