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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Issue with getting attribute value on form load

(0) ShareShare
ReportReport
Posted on by 5

Hi, 

I am trying to create validation onLoad that if a certain required field has a value, then hide it. I am using the following code to see if the field has a value:

var productInterestValue = formContext.getAttribute("znl_productinterest").getValue;

However, when I log the variable however it displays:

getValue(){const e="ClientApi.XrmEntityAttributeOptionSet.getValue";try{s.a.instance.reportCall(e);const t=this.getValueInternal(),n=Object(D.g)(t),r=Object(f.a)(n)?Object(D.f)(t,this.getAttributeType(),0):n;return s.a.instance.reportSuccess(e),r}catch(t){const n=v.a.getInstance().getEventParameters(this.contextToken);throw n.push({name:"attributeName",value:this.getName()}),v.a.getInstance().reportFailure(e,t,null,n),t}}

I'm pretty new to dynamics, so any help would be appreciated!

Thanks,

Joe

  • Verified answer
    Community Member Profile Picture
    on at

    just add "()" to getValue, like this:

    var productInterestValue = formContext.getAttribute("znl_productinterest").getValue();

    When you don't add the parentheses you are asking to retrieve the function definition instead of actually calling it.

  • joecampbelluk Profile Picture
    5 on at

    Knew it would be something simple! Thanks so much, hopefully this answer stops someone else asking a silly question in the future!

  • Community Member Profile Picture
    on at

    I am glad that was it Joe!

    Please mark it as answered then.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 77 Super User 2026 Season 2

#2
ParthPatel249 Profile Picture

ParthPatel249 56

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 44 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans