Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

error geocode longitude in dialog (decimal separator is missing?)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    error geocode longitude in dialog (decimal separator is missing?)

    After a day troubleshooting i turn here for help

    In a dialog i try to use the subscriber benefit builder for geoding addresses when saving a record.

    If only latitude and location field is specified in the buiilder than there is no problem in geocoding and storing the record. But as soon as i also specify the longitude control i get the error message below:

    :relaties_latitude (N) 52.1336113
    :relaties_longitude (N) 51962229
    :relaties_mutatiedoor (C) [email protected]
    :relaties_datumtijdmutatie (T) 02-07-2013 10:49:23 65 pm
    Database API specific error

    Your database has returned the following error code and description to Alpha Five.
    Consult your database documentation for further information.

    1264 - 'Out of range value for column 'Longitude' at row 1'

    It seems that the longitude field is not generated properly, i should be 5.1962229 (the decimal separator is missing)
    I doubled checked that in the mysql database the field definitions are the same for latitude and longitude (Decimal 11,8)

    Any clue?
    Last edited by cptutrecht; 07-03-2013, 05:09 PM.
    Ger Kurvers
    Alpha Anywhere / V4.6.1.9- Build 6488 (production) / V4.6.5.1 - 8722-5683(testing)
    Development: Mysql, windows 10 64 Applicationserver: standard on Windows server 2019

    #2
    Re: error geocode longitude in dialog (decimal separator is missing?)

    Originally posted by cptutrecht View Post
    (Decimal 11.8)
    Not using MySQL but I have a datatype of numeric(15,8) which works just fine in MSSQL.
    That's not a typo is it (Decimal 11comma8)?

    Stephen
    Alpha Anywhere v12.4.6.5.2 Build 8867-5691 IIS v10.0 on Windows Server 2019 Std in Hyper-V

    Comment


      #3
      Re: error geocode longitude in dialog (decimal separator is missing?)

      Hi Stephen, indeed this was a typo in my post, it must be: decimal 11,8 (i corrected that post now)

      In the database it was correct.
      And after another evening troubleshooting still have the same result / error.

      Tried a way to bypass the builder for the latitude / longitude field, but no luck yet.

      I tried storing the latitude / longitude values in the afterDialogValidate event:

      dim pa a p
      dim address as c

      address = e.DataSubmitted.Relaties_straat_postbus + " " + e.DataSubmitted.Relaties_huis_postbus_num + " " + e.DataSubmitted.Relaties_woonplaats
      pa = geocode_address("address","Google")

      e._set.myvar_latitude = pa.lat
      e._set.myvar_longitude = pa.lon
      and call in the afterInsertRecord event of call the xbasic function

      function afterRecordInsert as v (e as p)
      dim cn as sql::Connection
      dim sql as c
      dim args as sql::Arguments


      a5SQLConnectionOpen(cn,"::name::CPTDEMO", session)

      args.add("primaryKey",e.primaryKeyOfInsertedRecord)

      'below are state vars set in the afterDialogValidate event

      args.add("lat",e._set.myvar_latitude)
      args.add("lon",e._set.myvar_longitude)

      sql = "UPDATE relaties SET relaties.latitude = :lat, relaties.longitude = :lon WHERE relaties.relaties_nummer = :primaryKey"

      cn.Execute(sql,args)

      cn.close()
      end function
      But no luck either thusfar
      Ger Kurvers
      Alpha Anywhere / V4.6.1.9- Build 6488 (production) / V4.6.5.1 - 8722-5683(testing)
      Development: Mysql, windows 10 64 Applicationserver: standard on Windows server 2019

      Comment


        #4
        Re: error geocode longitude in dialog (decimal separator is missing?)

        Hi Ger,

        I'm no SQL expert but that error sure sounds like a type mismatch to me. But I could be wrong too .. so, this is how I have my dialog set up and working.

        MS-SQL fields: Latitude numeric(15,8) and Longitude numeric(15,8) in a table called suppliers

        Dialog has 2 equivalent textbox numeric controls called latitude and longitude. Controls are bound to the SQL fields in data binding.

        Dialog.jpg

        In the ServerSide Events: afterDialogValidate calling the ExecuteServerSideAction("Save Data::Save Data") action script

        SaveEvent.jpg

        In the Action Script settings Geocode record:

        ServerSideAction.jpg

        I've set
        address controls as Address, City, State, Country
        table alias as suppliers
        latitude control = Latitude
        longitude control - Longitude
        Not using location field

        GeocodeRecord.jpg

        That's it. This just works for me! Don't know if this helps you at all but hopefully you might see something.

        Cheers,
        Stephen
        Last edited by iRadiate; 07-03-2013, 07:57 PM. Reason: typo
        Alpha Anywhere v12.4.6.5.2 Build 8867-5691 IIS v10.0 on Windows Server 2019 Std in Hyper-V

        Comment


          #5
          Re: error geocode longitude in dialog (decimal separator is missing?)

          And here's the lat and long fields populated:

          Alpha.jpg
          Alpha Anywhere v12.4.6.5.2 Build 8867-5691 IIS v10.0 on Windows Server 2019 Std in Hyper-V

          Comment


            #6
            Re: error geocode longitude in dialog (decimal separator is missing?)

            Thanks Stephen for your clear examples.
            I followed your steps in my dialog with still the same error, see my screenshot below.

            Only difference perhaps
            + my dialog is in a modal popup called from an actionbutton on a grid
            + maybe we define the lat / long controls in the dialog different? I define them as textbox / Numeric, You too? (can't see that in your pictures)



            errorscreenlatlong.png)

            I know the problem is not in the database: in the GRID there is the editfunction for the adresses. And i use the code below in the after update record to update the lat long fields, which works like a charm:

            if (e.DataSubmitted.relaties_straat_postbus <> e.OldDataSubmitted.relaties_straat_postbus .OR. e.DataSubmitted.relaties_huis_postbus_num <> e.OldDataSubmitted.relaties_huis_postbus_num .OR. e.DataSubmitted.relaties_woonplaats <> e.OldDataSubmitted.relaties_woonplaats) then

            dim pa as p
            dim address as c

            dim cn as sql::Connection
            dim args as sql::Arguments
            dim flag as l
            dim sql as c

            address = e.DataSubmitted.relaties_straat_postbus + " " + e.DataSubmitted.relaties_huis_postbus_num + " " + e.DataSubmitted.relaties_woonplaats
            pa = geocode_address(address,"Google")


            args.add("primaryKey",e.DataSubmitted.relaties_nummer)
            args.add("lat",pa.lat)
            args.add("lon",pa.lon)


            ' We need to set cn.PortableSQLEnabled = .t. else function GeogCreateLocation(:lon, :lat) in sql update will fail

            cn.PortableSQLEnabled = .t.

            flag = a5SQLConnectionOpen(cn,"::name::CPTDEMO", session)

            if flag = .t. then
            sql = "UPDATE RELATIES SET latitude = :lat, longitude = :lon, location = GeogCreateLocation(:lon, :lat) WHERE relaties_nummer = :primaryKey"

            flag = cn.execute(sql,args)

            cn.close()
            end if
            end if
            Ger Kurvers
            Alpha Anywhere / V4.6.1.9- Build 6488 (production) / V4.6.5.1 - 8722-5683(testing)
            Development: Mysql, windows 10 64 Applicationserver: standard on Windows server 2019

            Comment


              #7
              Re: error geocode longitude in dialog (decimal separator is missing?)

              Originally posted by cptutrecht View Post

              Only difference perhaps
              + my dialog is in a modal popup called from an actionbutton on a grid
              Me too, I'm calling a modal popup from an action button on my grid:

              Modal-Popup.jpg


              Originally posted by cptutrecht View Post
              + maybe we define the lat / long controls in the dialog different? I define them as textbox / Numeric, You too? (can't see that in your pictures)
              Yes, mine are textbox / numeric also:

              LatControl.jpg

              This is very strange that it geocodes correctly for your lat but not long. I would almost be tempted to create a new dialog from scratch just because I don't see anything you've done wrong. Extra work but it might rule out a corrupt dialog. I am very interested in knowing what this might turn out to be.

              I'm curious if you were to change the database type of your long field to INT or BIGINT if it would accept it (of course I know it's still wrong). Just thinking out loud.

              Stephen
              Alpha Anywhere v12.4.6.5.2 Build 8867-5691 IIS v10.0 on Windows Server 2019 Std in Hyper-V

              Comment

              Working...
              X