Skip to main content
Solved

API insert data latitude longitude

  • October 19, 2022
  • 9 replies
  • 179 views

Forum|alt.badge.img
  • Jr Varsity III
  • 51 replies

What API can I use to insert longitude latitude for customer location, I found in customer location api but I don't find longitude latitude field? 

Best answer by Fernando Amadoz

@abdi 

Testing in a fresh demo environment would be my most immediate suggestion.

This will allow you to discard if it’s a customization or data issue.

View original
Did this topic help you find an answer to your question?

9 replies

Fernando Amadoz
Jr Varsity I
Forum|alt.badge.img+2

@abdi You should extended the CustomerLocation endpoint as those fields are not available in the OOB definition.

See in the following image the 2 fields being added at the bottom of the grid:

 

I am attaching a customization project that installs this extension in case you’d like to test it locally.

After that, you can refer to those fields in your PUT request:

 

Result

 


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 51 replies
  • October 20, 2022

hi @Fernando Amadoz Thank you so much, in API url in params $filter what value should i fill in?


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 51 replies
  • October 20, 2022
abdi wrote:

hi @Fernando Amadoz Thank you so much, in API url in params $filter what value should i fill in?

 


Fernando Amadoz
Jr Varsity I
Forum|alt.badge.img+2

@abdi to insert/update records, in most cases you do not need to specify the filter parameter in the URL. It is indicated in the payload.

Acumatica identifies the record based on the primary key definition.

Example

PUT: http://[Instance]/entity/DefaultSetup/20.200.001/CustomerLocation

{
    "Customer": {
        "value": "AACUSTOMER"
    },
    "LocationID": {
        "value": "1006"
    },
    "LocationName": {
        "value": "TESTABC"
    },
    "AddressOverride": {
        "value": "true"
    },
    "LocationContact": {
        "Address": {
            "AddressLine1": {
                "value": "Line1"
            },
            "AddressLine2": {
                "value": ""
            },
            "City": {
                "value": "Cleveland"
            },
            "Country": {
                "value": "US"
            },
            "Latitude": {
                "value": "211"
            },
            "Longitude": {
                "value": "322"
            }

        },
        "DisplayName": {
            "value": "DisplayName"
        },
        "Attention" : {
            "value": "Attention"
        }
    }
}

For customer Location, the primary key is: Customer, LocationID.

If Acumatica does not identify this combination as created in the DB, then a new record will be created.

If the record does exist in the DB, then the specific values indicated are updated.

For instance, this reduced payload will update Latitude info only:

{
    "Customer": {
        "value": "AACUSTOMER"
    },
    "LocationID": {
        "value": "1006"
    },
    "LocationContact": {
        "Address": {
            "Latitude": {
                "value": "511"
            }

        },
    }
}

 


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 51 replies
  • October 20, 2022

hi @Fernando Amadoz I have tried but instead create a new customer location instead of updating, such as copying data from the customer and the latitude and longitude remains unfilled, I also tried to update the PostalCode field and the results did not change

 

 

 

 

 

 


Fernando Amadoz
Jr Varsity I
Forum|alt.badge.img+2

@abdi 

Your payload looks correct.

I’d suggest testing it using a SalesDemo environment without customizations.


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 51 replies
  • October 21, 2022

Hi @Fernando Amadoz is there any other solution?


Fernando Amadoz
Jr Varsity I
Forum|alt.badge.img+2

@abdi 

Testing in a fresh demo environment would be my most immediate suggestion.

This will allow you to discard if it’s a customization or data issue.


Fernando Amadoz
Jr Varsity I
Forum|alt.badge.img+2

@abdi 

Were you able to test it in a fresh environment?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings