locked
How to set default lookup types in CRM 2016 with Turbo Form "On" RRS feed

  • Question

  • I need help!!

    When Turbo Form was introduced in CRM 2016 on prem, we are running into issues with javascript codes. One particular issues is with limit the lookup types such as limit Potential Customers to "Accounts" only.

    Since document.getElementById is no longer supported and will break under Turbo Form, what is the alternative to achieve the same functionality as the following code ?

        document.getElementById("customerid").setAttribute("defaulttype", "1");
        document.getElementById("customerid").setAttribute("lookuptypes", "1");
        document.getElementById("customerid").setAttribute("lookuptypenames", "account:1:Account");   

    I've already confirmed that replacing it with Xrm.Page.getControl("customerid")..setAttribute(...) does not work in this case.

    your help is greatly appreciated!

    Friday, February 5, 2016 8:02 PM

Answers

  • Hello,

    Just FYI such DOM manipulations never were supported.

    The only supported way I see is following:

    1. Create custom lookup that references account entity.

    2. Put in on form and hide customer field.

    3. Using script when custom account lookup is changed - change customer field populating it with value from custom lookup field.


    Dynamics CRM MVP
    My blog

    Friday, February 5, 2016 8:25 PM
    Moderator