web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Xrm.Page.ui and Xrm.Page.data returning null in CRM 2015 but not 2013

(0) ShareShare
ReportReport
Posted on by 55

Hi Guys, is any experiencing this problem or has any one expereienced it? Xrm.Page.ui and Xrm.Page.data returns null with CRM 2015 but not 2013.

Thanks in advance for your early response.

Fred

*This post is locked for comments

I have the same question (0)
  • Fred Adun Profile Picture
    55 on at

    Thanks Guido for the quick reply. However, I am using the script inside the account form. I have also tried debugging using the web developer console and the response is the same. If you have CRM 2015 Press F12 and type frames[0].Xrm.Page.ui / data in the response and tell what you get.

    Thanks again

  • Fred Adun Profile Picture
    55 on at

    There are no single form type attached to the form. And this is not just happening to one environment. I have tried 3CRM 2015 environment and the behaviour is the same. And this behaviour is different for 2013. This seems to be a bug in 2015.

  • Fred Adun Profile Picture
    55 on at

    I meant to say there are no single script on the form, and akso its not one form. I tried alert(Xrm.Page.ui.getFormType()); I got "Unable to get property 'getFormType' of undefined or null reference".

  • Fred Adun Profile Picture
    55 on at

    I turned to the console when the script I wrote to fire in the form wouldnt fire. I just wanted to the reaction of the code using the console.

    BTW using frames[1] worked using the console.

    Here below is the code that will not fire, please advice

    function preFilterSubCategoryLookup()

    {

    Xrm.Page.getControl("py3_category").addPreSearch(function () {

    var categoryObject = Xrm.Page.getAttribute("py3_category").getValue();

    // Get the lookup Object, and extract the Value (ID and Text)

    if(categoryObject != null)

    {

    var categoryTextValue = categoryObject[0].name;

    var categoryID = categoryObject[0].id;

    // Filter the Sub Category by Parent Category

    fetchXml = "<filter type='and'><condition attribute='py3_parentcategory' operator='eq' uiname='" + categoryTextValue + "' uitype='py3_category' value='" + categoryID + "' /></filter>";

    // Apply the filter to the field

    Xrm.Page.getControl("py3_subcategory").addCustomFilter(fetchXml);

    }

    });

    }

  • Fred Adun Profile Picture
    55 on at

    Thank you once agian Guido. However I am trying to impliment a dependent lookup with self referencial entity and then apply a filtered lookup. The code above is basically for filtered lookup, and its the new approach with 2015.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans