locked
How to make URL active on a closed case form RRS feed

  • Question

  • Good Day,

    I've added a URL field to the case entity which is needed to link to an online support ticket with our company.  Whenever the case is resolved, the field grays out and will not allow for further click thru on the link.  Is there any way to have the link stay active after resolving a case?

    Monday, March 12, 2012 11:10 PM

Answers

  • Hi Chief Teq,

    Put something like this in your case onload event should do the job. Hope this helps.

    function urlclick()
    {
       if (Xrm.Page.ui.getFormType() == 4) //ie Closed or Cancelled Cases
       {
               Xrm.Page.ui.controls.get("new_url").setDisabled(false);
       }
    }


    Eric UNG [Senior Analyst Programmer :: Sydney, Australia]

    • Proposed as answer by Weekendly Tuesday, March 13, 2012 2:13 AM
    • Marked as answer by Chief Teq Tuesday, March 13, 2012 3:28 PM
    Tuesday, March 13, 2012 12:46 AM
  • Step3: Then setup the onload event handler to call the function

    Step4: Save and Publish.


    Eric UNG [Senior Analyst Programmer :: Sydney, Australia]

    • Marked as answer by Chief Teq Monday, March 19, 2012 11:04 PM
    Wednesday, March 14, 2012 4:54 AM

All replies

  • Hi Chief Teq,

    Put something like this in your case onload event should do the job. Hope this helps.

    function urlclick()
    {
       if (Xrm.Page.ui.getFormType() == 4) //ie Closed or Cancelled Cases
       {
               Xrm.Page.ui.controls.get("new_url").setDisabled(false);
       }
    }


    Eric UNG [Senior Analyst Programmer :: Sydney, Australia]

    • Proposed as answer by Weekendly Tuesday, March 13, 2012 2:13 AM
    • Marked as answer by Chief Teq Tuesday, March 13, 2012 3:28 PM
    Tuesday, March 13, 2012 12:46 AM
  • Worked beautifully Eric! Thanks so much for your response.

    And now, on to the next question :)  I applied this in our current system (CRM 4) but am also in the midst of upgrading us to CRM 2011. 

    With the changes in 2011 can you please help me to understand how this would work?  If I understand correctly, I believe that I need to create a web resource = to the above code.  Where I lose my way is in setting the onLoad event handler properties.  I've chosen the new_CaseURL web resource library that I created, set the Function to urlclick, checked enabled, and that's where I draw a blank.....I don't know what the proper parameter is to pass on via the handler....I tried 'new_url' but am getting the below error message. 

    Any further insight you have would be much appreciated!
    Tequisha


    • Edited by Chief Teq Tuesday, March 13, 2012 3:48 PM
    Tuesday, March 13, 2012 3:47 PM
  • Yes, you are on the right track.

    For CRM2011. You need to create or add the function to a JScript Web Resource. Then you will need to include that web resource in the case main form entity and hook the onload event to the function. The passing of the parameter is not required for this function because the function uses the literal attribute name.

    Anyway, here is a few screen shots that might assist you.

    Step1: Goto the Case Main form and click on Form Properties

    Step2: Then add the JScript web resource to the Case Form Libraries


    Eric UNG [Senior Analyst Programmer :: Sydney, Australia]

    Wednesday, March 14, 2012 4:54 AM
  • Step3: Then setup the onload event handler to call the function

    Step4: Save and Publish.


    Eric UNG [Senior Analyst Programmer :: Sydney, Australia]

    • Marked as answer by Chief Teq Monday, March 19, 2012 11:04 PM
    Wednesday, March 14, 2012 4:54 AM
  • Thanks again, Eric! 

    I just had to remove the parameters I was attempting to pass (via the event handler) and it's now working.

    Thanks again for your assistance ; )
    Tequisha

    Monday, March 19, 2012 11:06 PM