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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

error getValue in javascript CRM 365

(0) ShareShare
ReportReport
Posted on by 462

Hi,

I'm try to retrieve data based on lookup in custom form by using javascript.

this is my code

// JavaScript source code
function GetActivityObjectiveType()
{
var lookupObj = new Array();
lookupObj = Xrm.Page.getAttribute("ibizcs_activityobjective").getValue();
//check for the value
if (lookupObj != null)
{
var Name = lookupObj[0].Name;
var ID = lookupObj[0].id;
var EntityType = lookupObj[0].entityType;
alert(Name);
}
}

when I run the form, and choose the field "ibizcs_activityobjective", it shows an error "Unable to get property 'getValue' of undefined or null".

how to solve this issue? I confirm that the field is on the form.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at
    RE: error getValue in javascript CRM 365

    Are you calling this function on Change event of field ibizcs_activityobjective. If yes, Are there any other functions called on this field. Only one thing i can see in your code which is incorrect.

    var Name = lookupObj[0].name;

    and Instead of these two lines use this line:

    var lookupObj = new Array();

    lookupObj = Xrm.Page.getAttribute("ibizcs_activityobjective").getValue();

    var lookupObj = Xrm.Page.getAttribute("ibizcs_activityobjective").getValue();

    https://arunpotti.wordpress.com/2014/12/19/get-lookup-id-text-entityname-in-crm-using-javascript/

  • Verified answer
    Nadeeja Bomiriya Profile Picture
    6,804 on at
    RE: error getValue in javascript CRM 365

    Hi Denis,

    Please double check the field name ibizcs_activityobjective.

    Also try below code to see if you are getting a non-null value.

    lookupObj1 = Xrm.Page.getAttribute("ibizcs_activityobjective");

    If lookupObj1 is null, then the field name is incorrect.

  • Suggested answer
    xcode17 Profile Picture
    462 on at
    RE: error getValue in javascript CRM 365

    Already resolve this 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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans