Options

Getting "precise" coordinates within NAV 2016

barandenizbarandeniz Member Posts: 44
Hi, for a customer, we did a development which saves users current location to a record so after some time user can see the records location. But the problem is when we take coords from nav, they are not precise. When user takes the location from WhatsApp, the location (coords) are much more precise. How can make NAV use High Accuracy options? Which C/AL code do i need to put there so NAV will use High Accuracy ??

Answers

  • Options
    okioki Member Posts: 46
    To store coordinate values, set table field property "Data Type" to decimal.
    Also set table field property "DecimalPlaces" to 0:18. You should now be able to enter and view floating point values in high accuracy.
    The problem seems to be, when you retrieve the value (per web service, i assume).
    NAV will eventually use the default accuracy of 0:2 or 0:5. With the settings above this will be fixed.

    Oki
  • Options
    barandenizbarandeniz Member Posts: 44
    oki wrote: »
    To store coordinate values, set table field property "Data Type" to decimal.
    Also set table field property "DecimalPlaces" to 0:18. You should now be able to enter and view floating point values in high accuracy.
    The problem seems to be, when you retrieve the value (per web service, i assume).
    NAV will eventually use the default accuracy of 0:2 or 0:5. With the settings above this will be fixed.

    Oki

    I set the Data Type to Text so there is no decimalplace restiriction.

    https://msdn.microsoft.com/en-us/library/mt574342(v=nav.90).aspx

    There are 3 options for Location Automation thing. But i can not find how and where to use these options. I think my problem will be solved if i use these options with right way.
  • Options
    barandenizbarandeniz Member Posts: 44
    Up..
  • Options
    barandenizbarandeniz Member Posts: 44
    Up...
  • Options
    okioki Member Posts: 46
    Hi,
    as I wrote before, set the data type to decimal. If you set it to text, a conversion will take place at the time you assign the coordinate value to the text field.

    If you want to really rely on the text type, you can format the assignment yourself:
    TextLatitude := FORMAT( Location.Coordinate.Latitude,0,'<Precision,0:18><Standard Format,0>');

    I highly recommend you to use the decimal type, which has always the best precision and is not depending on localized formats (decimal separator,thousand separator)

    Oki
Sign In or Register to comment.