CRM 2013 JScript Execution in parallel with Form Header. RRS feed

  • Question

  • I have one Java script that executes on Form Load event. Problem, is because of default CRM 2013 Form load behavior,  CRM Form loads fully and then it executes our custom JavaScripts, so user can literally see the Original Form layout and then whatever changes we do in our JScripts.

    i mean CRM 2013 takes some time to Load  form and it always load form in sequence like Form GUI, Enable Rule first, then Form Scripts and then CommandAction.

    Is there any way, we can Load & Execute our Custom JavaScript at the same time CRM Form Header Loads?? i mean can we change the sequence of load and execute for our Custom JavaScript before form Tabs/Sections/Fields get loaded??

    I have read few online articles but they just metion how this stuff loads, but they don't have any tricks to load our custom scripts before form loads. 

    Wednesday, September 10, 2014 4:12 PM

All replies

  • In this scenario normally I suggest to set the visibility of the components inside the form to the most used one.

    for example if in your script you have 5 fields visible by default and inside your onload event you check a condition and hide them or not, check how often this condition is executed, if for example 90% of the times you hide the fields, it's better to set the visibility as hidden by default and make them visibile again by script.

    My blog: www.crmanswers.net - Rockstar 365 Profile

    Wednesday, September 10, 2014 4:22 PM
  • Well Guido thanks for reply. but what i am asking to the trick How to execute our custom javascript before CRM Form Loads?? Any idea??
    Wednesday, September 10, 2014 6:44 PM
  • Guido , i got what you are trying to say to Make invisible all other components and Make then Visible along with My Custom Component. But How can  i do this in Form Header Section??

    I mean our script will run no matter what after the original Form loads. So how can i make all Header Component Invisible before form loads?? Any code sample / guidance / articles / blogs??

    Please assist.

    Thursday, September 11, 2014 1:25 PM