O JavaScript é a única ferramenta/linguagem para manipulação de objetos client no CRM, e mesmo com os esforços no desenvolvimento de frameworks encontrados nas últimas versões do CRM (como o “Xrm”), a depuração em run-time ainda torna-se complicada para ser feita, deste modo, a solução de erros como o famoso “objeto esperado” torna-se bem complicada e demorada.
Assim, podemos usar o objeto “debugger” nativo do JavaScript, com ele poderemos usar um breakpoint e depurar o script, igualmente o que já fazemos com o .net. Para utilizar este recurso, primeiramente é preciso habilitar a depuração de scripts, no menu do IE navegue até ferramentas>internet explorer conforme a figura à seguir:
Depois, basta adicionar o comando debugger no evento ao qual deseja depurar, por exemplo: Entre na entidade conta, abra o formulário e no evento load adicione:
...
debugger;
...
E por fim, basta acionar o evento ao qual inseriu o debugger, neste momento aparecerá em que programa deseja depurar, escolha qualquer Visual Studio que tenha instalado e depure o quanto necessitar!
I have been working with IT since 2006, almost of this time, I was working with Microsoft Dynamics CRM/365 as a source of solutions. I graduated in Bachelor of Information Systems at FIAP (Faculdade de Informatica e Administracao Paulista) in 2012.I really love what I do! Technology has been my interest since always. Even in a world too different of the current one, when we haven't had the internet, tablets, smartphones and social networks!Although I have worked in some different roles, I can't give up "the developer's life". Even knowing that I'm still so far of the greatest developers. Development is the thing that I love to do!I started my contributions with the Microsoft Dynamics community in 2010. At the beginning, I used to help at MSDN and TechNet forums. But now, I'm fully dedicated to this blog!I have the enormous honour of being the only Brazilian who got the award for Microsoft MVP (Most Valuable Professional) for Microsoft Business Applications (Dynamics 365). I have been receiving the award since 2012.In my free time. I like to cook, do some hiking, watch movies/series and when it's possible, travel!
Ver todos os posts por Tiago Michelini Cardoso