如何在queryDef中查询收件人全部字段而非逐个选择
How to Retrieve All Fields for nms:recipient Without Manual Selection
Hey there! To grab all fields from the nms:recipient schema instead of listing each one manually, you can use the wildcard * in your <select> node. This tells the query definition to fetch every available field for the matching recipients.
Here's your updated code:
var query = xtk.queryDef.create( <queryDef schema="nms:recipient" operation="getIfExists"> <select> <!-- Use wildcard to fetch all fields --> <node expr="*"/> </select> <where> <condition expr={"@Id='93975738'"}/> <condition expr={"@company='xxxx'"}/> </where> </queryDef>) var result = query.ExecuteQuery(); logInfo(result.toXMLString());
A Quick Note:
- The
expr="*"acts as a wildcard that includes all top-level fields of thenms:recipientschema. This saves you from manually enumerating every field like@firstName,@lastName, etc. - If you ever need to exclude specific fields while keeping the rest, you can add an
excludeattribute to a node. For example:<select> <node expr="*"/> <!-- Exclude a specific sensitive/unneeded field --> <node expr="[@password]" exclude="true"/> </select> - Keep in mind that fetching all fields might include some system-generated or unused fields, but it's perfect when you need the full recipient record without missing anything.
内容的提问来源于stack exchange,提问作者AZahlan
相关产品推荐
相关产品推荐

