Thanks, appreciate if anyone could guide me how can I onload the javascript as the page loads in ERPNext so I could make the address or location autocomplete works.
UPDATE: I couldn’t found a way to make the javascript to be running when the page onload. So the autocomplete aren’t able to implement. If there is anyone know to do this please do DM me and I will try to make the autocomplete work.
@Seng You could to it by changing this frappe.ui.form.on("Employee", "load_this", function(frm){
To this frappe.ui.form.on("Employee", "refresh", function(frm){
It will run on every refresh, because if you do onload and there is no address in mentioned in the field, it will not listen anymore after the page loads. While on refresh it will listen continuously.
You could to it by changing this
frappe.ui.form.on(“Employee”, “load_this”, function(frm){
To this
frappe.ui.form.on(“Employee”, “refresh”, function(frm){
@mrmo Thanks for the suggestion, but however, I tried to replace the button click trigger to refresh or onload, the whole script will freeze and not functioning in ERPNext.
@Seng Can you share the script or you right click on the page and click “inspect element” and go to “console” to share the error on the page, will be helpfull.
@mrmo I am using the exact same script in the documentation above by changing
frappe.ui.form.on(“Employee”, “load_this”, function(frm){
to
frappe.ui.form.on(“Employee”, “refresh”, function(frm){
OR
frappe.ui.form.on(“Employee”, “onload”, function(frm){
It gives me the error as refer to the image below. This error does not happen when I am using it as a button to call the function.
Greetings
is this code still operational in the current version(7/7.2) so that i can use it?
What i want is to assign locations to customers then add some extra costs to someone in more than 10km…
kr
The Google Maps API does not do CASS Certified address correction, but something like the places autocomplete could do the job for most of us. If you want to go against a certified USPS database I’d recommend using something like Semaphore’s ZP4 software by exporting the data from ERPNext. Not the most efficient way but we just take a few minutes and put all of our new customer’s addresses through at the end of the month.
Thanks @cattmy. I am familiar with this and some other CASS address hygiene products. You are right that the autocomplete would probably work for most.
Hi may be out of subject.
We wanted our driver to get a direction link for all deliveries’ location in google maps.
For that we will keep a record of google maps decimal degrees(dd) and/or makani number(local UAE location identification).
I found a way if our ERPNext developer will able to generate a link as per below. He agreed and currently under process.