locked
Service Activity Lookup RRS feed

  • Question

  • Is it possible when booking a service activity in crm online, when selecting resource the lookup goes to look for Facility/Equipment & NOT Look for User?

    Thanks in advance

    Monday, September 3, 2012 2:17 PM

Answers

  • First thing is you need to determine the GUID of the Facility/Equipment Lookup View

    Open the Facilities/Equipment entity and go to the views, open Facility/Equipment Lookup View and hit F11 to get it full screen so you can see the URL - it should look something like this:

    https://domain.crm.dynamics.com/tools/vieweditor/viewManager.aspx?appSolutionId=%7bFD140AAF-4DF4-11DD-BD17-0019B9312238%7d&entityId=%7bA7A0B367-219B-44DE-9EE9-239E3B5C7A4E%7d&id=%7b84F76829-AABB-467E-8F8E-5FC6A3B448AF%7d#

    Make note of the last GUID (bolded above) after the id=%7b (be careful when cutting and pasting)

    Create a web resource file and place the follow code in it:

    function OnLoad() {
        document.getElementById("resources").setAttribute("defaulttype", "4000");
        Xrm.Page.getControl("resources").setDefaultView("84F76829-AABB-467E-8F8E-5FC6A3B448AF");
        document.getElementById("resources").setAttribute("lookuptypenames", "equipment:1:Facilities/Equipment");
        document.getElementById("resources").setAttribute("lookuptypes", "4000");
        document.getElementById("resources").setAttribute("lookuptypeIcons", "/_imgs/ico_16_4000.gif");
    }
    

    On the line:

    Xrm.Page.getControl("resources").setDefaultView("84F76829-AABB-467E-8F8E-5FC6A3B448AF");

    You will need to replace the value with the one you retrieved from the view's URL.

    Go through and add the web resource to the Service Activity and call the 'OnLoad' event on the form's OnLoad event.

    This should lock the resource type to only Facility/Equipment views.

    Keep in ind this is also probably not supported. 


    Jason Lattimer

    Wednesday, September 5, 2012 2:52 AM
    Moderator