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)

Getting the field type in JavaScript

(0) ShareShare
ReportReport
Posted on by

Hi,

I apologise if this has been posted before but I cannot find a page anywhere discussing this and I have been searching for at least a couple of hours now.  All I want to know is if there is a property that tells me the type of the field, i.e. String, Lookup, etc.

I ask because I am writing a CRM/Navision integration library and certain field values in CRM, when changed, are to be sent over to Navision.  All my code is in JavaScript for the following implementation: I record the changes in an array (just the field name) and when the form is saved it loops through all the changed fields and gets the value.  I am using DataValue property but the problem is that the actual value of this property is dependant on the field type, i.e. for a String field it is a string value, for Lookup field it is an object with properties.  I would like to be able to have a switch statement that is case'd by the type of the field so I know what to do with the DataValue value.

Has anyone got any ideas?  I would have thought this to be very simple, but all the examples I have seen so far make the assumption or are based on the fact that the field type is known/fixed and that the DataValue value is known/fixed prior to using it.

Any help with this will be very much appreciated.

*This post is locked for comments

I have the same question (0)
  • Kenny Vaes Profile Picture
    345 on at

    I don't think this is possible by using JavaScript.

    But why not use a plugin on each entity that needs to be synced to NAV? That way you can easily get the datatype of each property in .NET.

  • Community Member Profile Picture
    on at

    Hi Kenny,

    Thanks for the reply, it is as I suspected - I doubt this functionality would be hard to do, and this is not in version 4.0?

    I am afraid that I am new to both Navision and CRM and so I have no idea about the plugins that you are talking about.  If you know of any URL's with good examples, explanations, code samples I can learn from, can you post a few please?

    Thanks

    - Maintex

  • Baris KANLICA Profile Picture
    User Group Leader on at

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