Here is a quick JavaScript code example. Having added a new opportunity on a contact I wanted to refresh the contact form and at the same time save any changes.
This concept might be useful in several circumstances, say you have a customization on the opportunity that updates fields on the contact. Then refreshing the contact page would allow those alterations to show.
When I am using USD I intend to experiment with using the Xrm.Page.data.refresh(save) command in RunXrmCommand actions. As I have several situations when I want to refresh the parent following creation of a child.
Hopefully you might find this useful.
function OnLoad() { setTimeout("Refresh();", 2500); } function Refresh() { Xrm.Page.getControl("contactopportunitiesgrid").addOnLoad(GridOnloadFunction); } function GridOnloadFunction() { var save = true; Xrm.Page.data.refresh(save); };
Happy coding. J
Great article. It is never enough of JavaScript 😉 Love to work with this language.
LikeLike
Pingback: USD – The Book | Microsoft Dynamics CRM and Unified Service Desk