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)

Unable to get property '0' of undefined or null reference Lookup field

(0) ShareShare
ReportReport
Posted on by 125

Recently ProductID lookup field in Opporunity Product dynamic crm form started throwing this error "Unable to get property '0' of undefined or null reference" when we tried to change this lookup field. There is no javascript called on Onchange event I have attached a screenshot of the error. I have disabled all the events already but still when i add a new product to opportunitiy by hitting the search button right to the productid field in opporuntiy product form i get this error message in a JS dialog There was an Error in this field customized event . Field : productid Event : setadditionalparams Error: Unable to get property '0' of undefined or null reference 

i haven't attached any function or javascript to onchange event of the lookup field.The error shows whenever we click on productid lookup field but after i close the error dialog by hitting the ok button i can pick a product out of the list. They seems no problem here, but the error message is annoying. 
1616.error.jpg

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    If you've removed all functions for onchange and published the changes as well, then it may be simply that you need to clear your cache. You may have removed the functions, but the scripts are still sitting in your local browser cache. Go to the form, and try CTRL+F5.

  • hussainahmad Profile Picture
    125 on at

    I have already tried it many times...

  • Suggested answer
    NatrajY Profile Picture
    3,040 on at

    Eventhough this is CRM2016, I believe the root cause is the same -> http://a-crm.blogspot.com.au/2016/03/crm-2016-update-lookup-field-bug.html

    Since you don't have any JS in the background causing this issue, please report this on connect and wait for the updates. You can also try the JS approach described in the blogpost and see if this makes any difference.


    Also worth installing the most recent update, if you are not already on it, and see if that fixes the issue.

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    Have you installed update 0.2 rollup ? If no, try to install latest update and see.

    Mansoor

  • Suggested answer
    Community Member Profile Picture
    on at

    I think there will be some parameters passed on Form. Check out once please. Go to form customization >> form properties >> and open Parameters tab and remove parameters from there.

    Regards,

    Rahul Chavan

  • hussainahmad Profile Picture
    125 on at

    @Natraj i am using CRM2015 7.0.1.129 . I guess thats why there is no "Use legacy form rendering" option in Settings-Administration-System settings

  • NatrajY Profile Picture
    3,040 on at

    Yes. That option won't be there. If installing Update 1.1 or Update 0.2 is not an option, you could try the setting the "type" prop on the lookup using JS as described in the post, and see if that works.

  • necsa Profile Picture
    3,455 on at

    Hi hussainahmad,

    please add your onchange event following code and try it,

    var proid = Xrm.Page.data.entity.attributes.get("productid").getValue();
    if (proid != null && proid .length > 0)
    {
     var priority = proid [0].name;}

    or try this solution;

    1. Go to Opportunity Product
    2. Remove the ProductID field (which is causing issue)
    3. Publish all customization and be sure it is not in the Form
    4. Add again on the Form ProductID field then publish all customization
    5. Chack if you still see the issue

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