how to refresh a form that is updated by a c# plugin - crm 2011
-
26. července 2012 11:05
hello friends.
i need help in refreshing an entity form after it is updated by a c# plug-in.
scenario:
entity A has a custom button i created (with ribbon editor)pressing the button will run a jscript that will update entity B.
once entity B gets updated a plugin (c# code) is firedthe plugin updates entity A.
all works great.The problem is: How to refresh the form for entity A ? (we open this form to press the button and its fields values are updated by the plugin - how do i see the new values - how to reload/refresh the form?)
Thanks in advance.
- Upravený miro ocho 26. července 2012 11:08
Všechny reakce
-
26. července 2012 11:17Moderátor
Hi,
There is no way to refresh crm entity form through plugin, but you can do a workaround using javascript, you can write a function in your entity a that will run after specific time slot and will check entity a in database if there is some updated value for your field you can call save method to refresh your form.
you can refer http://a33ik.blogspot.in/2009/05/page-refresh.html (this is for ms crm 4.0, but you can write function in same way for ms crm 2011)
Conatact Me
Follow me on Twitter
Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.- Navržen jako odpověď Mahender PalMVP, Moderator 26. července 2012 11:17
-
26. července 2012 11:41Hello Mahender.
thank you very much for you fast (very fast) response.
i will read the refernce you sent me and try to implament it on my system.
thanks alot, i'll update on how it went. -
26. července 2012 12:18Hello Mahender.
i understand the concept suggested ,
but when does this jscript supposed to run ? what event triggers it ? -
26. července 2012 14:24Moderátor
you can call your script on load of your entity and set time to call it after some interval to check update.Conatact Me
Follow me on Twitter
Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.- Navržen jako odpověď Mahender PalMVP, Moderator 26. července 2012 14:24
-
29. července 2012 9:12
i have used the code (midified to my system and entities)
and assigned it to run for an "OnLoad" event.
now i have a problem of an infinite loop.any ideas ?
-
29. července 2012 17:28
Hi Miro,
You can try this in the Javascript function where you are updating entity B. After the updation, you can wait for a few seconds, say 5 or 10 seconds and then reload the form.
//Wait for 5 seconds and reload the entity A form.
setTimeout(function(){window.location.reload(true);}, 5000);Regards,
Palani K.B.
If you find this helpful, please mark it as answer.
-
30. července 2012 8:10
Thanks !!!!!!!
that worked out great.
thank you guys for your help.