当前位置:网站首页>Dynamics crm: use setfilterxml to filter the records that need to be displayed in the subgrid control of the form
Dynamics crm: use setfilterxml to filter the records that need to be displayed in the subgrid control of the form
2022-07-22 07:32:00 【Stone-hdj】
We often use... In forms subgrid Control , Usually insert... In a form subgrid Used to display records in another entity , The displayed content is displayed by defining different views , It can also be done through javascript To do some control .
In today's blog post, we use another method to achieve flexible in subgrid Up to display customized records , That's what we need today setFilterXml.
Note: It needs to be explained in advance , This setFilterXml It doesn't appear in Microsoft's official documents , So I'm not sure which versions support , Which versions do not support , What I tried was Dynamics 365 9.0 On-premises and Dynamcis 365 9.2 online These two versions .
The following is an example , We are in the entity contact Has been inserted into the form Account The entity's Subgrid
And then we open up contact After a record of , Will see Account Of subgrid Control Account
open F12 Browser debug mode for , First get this Subgrid Control
var subgrid = Xrm.Page.getControl("AccountsSubgridTest")
Through this control, we can view its existing filter
subgrid.getFetchXml()
For example, we just want to subgrid It shows that Account Name by A All the records at the beginning , So we use the advanced search function to put this FetchXML download .
But notice that we need to replace the double quotation marks inside with the single quotation marks , And as long as filter Content in Tags .
<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='account'>
<attribute name='name' />
<attribute name='primarycontactid' />
<attribute name='telephone1' />
<attribute name='accountid' />
<order attribute='name' descending='false' />
<filter type='and'>
<condition attribute='name' operator='like' value='A%' />
</filter>
</entity>
</fetch>
That is to say
<filter type='and'><condition attribute='name' operator='like' value='A%' /></filter>
Then run the following code to set this subgrid Of filter
subgrid.setFilterXml("<filter type='and'><condition attribute='name' operator='like' value='A%' /></filter>");
Last refresh
subgrid.refresh();
Finally, we can see the display effect
Usually we can use setFilterXml This method is onload Event to realize the custom function of displaying records , It will have a higher degree of freedom than we use the filter conditions in the view , And you can display different records according to different conditions in your code , To achieve the effect we want .
边栏推荐
- Piecemeal knowledge - Business
- 数组实现可扩展的循环队列
- [a simple and clean log4j.properties complete configuration]
- Keras深度学习实战——基于Inception v3实现性别分类
- NoSQL数据库之Redis【数据操作、持久化、Jedis、缓存处理】详解
- 创建私有CA,我就用openSSL
- The difference between abstract class and interface interface in C #
- 公网官网建站笔记(五):域名工信部备案完整流程并解析公网访问
- Scala函数及其高阶应用
- 迪赛智慧数——其他图表(桑基图):暑假消费情况
猜你喜欢
Keras deep learning practice (10) -- transfer learning
Matlab GUI programming skills (VIII): uitoolbar create toolbar in the drawing window
Keras深度学习实战(10)——迁移学习
About troubleshooting MySQL driver version errors, cause: com mysql. jdbc. exceptions. jdbc4、Unknown system variable ‘query_ cache_ size
Piecemeal knowledge - SQL related
Loadlibrary Failed with Error 87 | Open QTCreator Failed
ECCV 2022 | 修正FPN带来的大目标性能损害:You Should Look at All Objects
124二叉树中的最大路径和
狂神redis笔记06
如何生成xmind的复杂流程图
随机推荐
Dynamics 365: Access Team Templates的用法
可视化之基础设置
软件-必备软件
银行的稳健型理财产品有风险吗?本金会亏吗?
Common questions of testers during interview
Web3, encrypted VC new air outlet
Interview algorithm questions
《通信软件开发与应用》课程结业报告
mysql加写锁不生效
撤回IPO申请,无人船艇企业云洲智能“游”不进科创板
22括号生成
ZBar项目简介及安装配置 | [email protected]
知觉的定义
如何在页面中添加地图
"New energy + energy storage" starts from the digital twin, Tupu will make smart power to the extreme
tsconfig. JSON cannot find any input in the configuration file. What should I do?
Keras deep learning practice (11) -- visual neural network middle layer output
2022/7/ 20 训练记录
数组实现可扩展的循环队列
【一个简单干净的log4j.properties完整配置】