locked
PreFilterLookup is not support in mobile form. RRS feed

  • Question

  • I wrote jvascript function for PreFilterLookup .It is support for manin form .But it doesn't support mobile form.

    Please find below code.Any suggestions??

    function FilterLookup () {
        try {

            var Frmtype = Xrm.Page.ui.getFormType();
            var lookupObject = Xrm.Page.getAttribute('to');
            if (Frmtype == 1 && lookupObject != null) {
                Xrm.Page.getAttribute('to').setValue(null);

            }
            var lookupData = Xrm.Page.getAttribute('to').getLookupDataAttribute();
            if (lookupData.getSupportedLookupTypes().length > 1 && lookupData.getSingleLookupTypeId() !== 2) {
                lookupData.setLookupTypes(['contact']);

            }

        }
        catch (e) {
            alert('An error has occurred: ' + e.message);
        }
    }

    Monday, September 26, 2016 9:25 AM

All replies

  • mobile form is not a main form.

    You can edit it in a entity forms. As i know, there is no js for mobile form.

    Monday, September 26, 2016 12:43 PM
  • yes .But It is not working in mobile form
    Tuesday, September 27, 2016 9:28 AM