SharePoint 2010:通过选择框选择触发查询设置字段值 [英] SharePoint 2010: Set field value from query triggered by choice box selection

查看:160
本文介绍了SharePoint 2010:通过选择框选择触发查询设置字段值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将表单字段链接到选择框选择,以便字段的值由选择框选择的ID引用的信息设置?我有一个自定义列表窗体中的选择框,它绑定到包含客户端名称,ID,参考号码,地址等的客户端列表。选择框显示客户端名称并将选定的值设置为ID。然后,我想通过选定的ID查询客户端列表,以填充客户名称,客户端地址,客户端电话等表单字段。有没有办法做到这一点,而不使用自定义代码?我使用的是SharePoint 2010,SharePoint Designer 2010和InfoPath for the forms。

How do you link a form field to a choicebox selection so that the field's value is set by the information referenced by the ID of the choicebox selection? I have a choicebox in a custom list form which is bound to a "Client" list which contains client names, IDs, reference numbers, addresses, etc. The choicebox displays the client name and has the selected value set to ID. I would then like to query the Client list by the selected ID to populate form fields with Client Name, Client Address, Client Phone, etc. Is there a way to do this without using custom code? I am using SharePoint 2010, SharePoint Designer 2010 and InfoPath for the forms.

推荐答案

我有一种感觉不支持,但我可以通过在 schema.xml

I have a feeling this is not supported, but I was able to get this working by creating fields as follows in the schema.xml of my custom list template:

<Field ID="{AB09A2D6-EBD4-4511-AE91-A8C54DC8442F}"
    Type="Lookup"
    Name="CustomItemIdLookup"
    DisplayName="Client"
    List="$Resources:core,lists_Folder;/Client"
    ShowField="Title"
    Hidden="FALSE"
    Required="TRUE"
    StaticName="CustomItemIdLookup">
</Field>
<Field ID="{E558933C-A03B-4932-85C9-6A786396AA78}"
    Type="Lookup"
    Name="CustomClientNameLookup"
    DisplayName="Client Name"
    List="$Resources:core,lists_Folder;/Client"
    ShowField="CustomClientName"
    Hidden="FALSE"
    JoinColName="tp_ID"
    JoinRowOrdinal="0"
    JoinType="INNER"
    FieldRef="CustomItemIdLookup"
    ReadOnly="FALSE"
    ShowInNewForm="FALSE"
    ShowInEditForm="FALSE">
</Field>
<Field ID="{5292CB52-80C7-4AFA-BA3E-93FDF22B37E3}"
    Type="Lookup"
    Name="CustomClientAddressLookup"
    DisplayName="Client Address"
    List="$Resources:core,lists_Folder;/Client"
    ShowField="CustomClientAddress"
    Hidden="FALSE"
    JoinColName="tp_ID"
    JoinRowOrdinal="0"
    JoinType="INNER"
    FieldRef="CustomItemIdLookup"
    ReadOnly="FALSE"
    ShowInNewForm="FALSE"
    ShowInEditForm="FALSE">
</Field>
<Field ID="{B3E22803-9A4B-4E7E-B05F-82221C182735}"
    Type="Lookup"
    Name="CustomClientPhoneLookup"
    DisplayName="Client Phone"
    List="$Resources:core,lists_Folder;/Client"
    ShowField="CustomClientPhone"
    Hidden="FALSE"
    JoinColName="tp_ID"
    JoinRowOrdinal="0"
    JoinType="INNER"
    FieldRef="CustomItemIdLookup"
    ReadOnly="FALSE"
    ShowInNewForm="FALSE"
    ShowInEditForm="FALSE">
</Field>

请注意,客户名称,客户地址,客户端手机将不可编辑,并且富文本/多行字段会显示不行。

Note, Client Name, Client Address, Client Phone will not be editable and rich text/multiline fields do not work.

这篇关于SharePoint 2010:通过选择框选择触发查询设置字段值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆