admin管理员组文章数量:1326338
I have a custom ribbon button on one of my CRM 2011 entities that will effectively disable that entity.
I then would like to refresh the current view on the homepage of that entity. I would like this triggered by JS.
Currently I'm able to refresh the whole parent window which will put me back at the dashboard and not the home page of that entity.
Thanks!
I have a custom ribbon button on one of my CRM 2011 entities that will effectively disable that entity.
I then would like to refresh the current view on the homepage of that entity. I would like this triggered by JS.
Currently I'm able to refresh the whole parent window which will put me back at the dashboard and not the home page of that entity.
Thanks!
Share Improve this question asked Nov 25, 2011 at 16:30 user1231231412user1231231412 1,6592 gold badges26 silver badges42 bronze badges 1- What do you mean by "home page"? The page where you see multiple records of that entity, or the editor page of a single record? and by disable, you mean deactivate? – Renaud Dumont Commented Nov 25, 2011 at 21:08
2 Answers
Reset to default 4Good question. Here are two ways you can do it:
//refreshes the entire element in the parent window that contains the view
window.parent.opener.location.reload();
//refreshes just the grid control that contains the view (probably what you're looking for)
window.parent.opener.document.getElementById("crmGrid").control.refresh();
If someone is ing here for Dynamics 365
Do the following for the custom Ribbon Button:
PrimaryControl
as CrmParameter
to your JS function
function yourJSFunction(primaryControl) {
// Do your stuff
primaryControl.refresh();
}
Example for Xrm.WebApi.online.executeMultiple(...)
:
function yourJSFunction(primaryControl) {
// Create the requests
// ...
Xrm.WebApi.online.executeMultiple(requests)
.then(function (result) {
primaryControl.refresh();
});
}
本文标签: cHow do I refresh the list on the homepage view of an entityStack Overflow
版权声明:本文标题:c# - How do I refresh the list on the homepage view of an entity - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742199725a2431727.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论