This topic is locked
[SOLVED]

 Using WAZE navigation in PHPRunner

7/31/2018 4:53:23 AM
PHPRunner General questions
S
shoppy author

Hi all,
I have a database with customer addresses.

I have the corresponding coordinates (latitude and longitude) in fields 'latitude' en 'longitude'.
I made a button on the view page of the customer.

By clicking on that button the user can start up WAZE navigation.
I now need to bring the values of these 2 fields into a link address to a website (location.href).
A fixed link looks like "https://www.waze.com/ul?ll=52.37461670%2C4.90419388&navigate=yes&zoom=17";

If I put that into the 'Client Before' part of the button it goed straight to that address. So that works!
But now I need the values from 'latitude' and 'longitude' from the record 'Naam' in the link.

How do I do that?

S
shoppy author 7/31/2018

I changed the opening post a little bit so you understand what I need.

S
shoppy author 7/31/2018

This is what I did so far:
client-after

function On(result, ctrl) {

var latitude = result['latitude'];

var longitude = result['longitude'];

window.location.href = 'https://www.waze.com/ul?ll='; + latitude + '%2C' + longitude + '&navigate=yes&zoom=17';

}


server

function On($params, $result) {

global $dal;

$record = $button->getCurrentRecord();

$result = [

'latitude' => $record['latitude'],

'longitude' => $record['longitude']

];



return $result;

}


But it doesn't work

What am I missing??

K
KevinMillican 8/7/2018



But it doesn't work

What am I missing??


I think you're trying to do it the hard way.
Why not add the link as a calculated field, eg. add this to your SQL query at the end of the SELECT statement :-
concat("https://www.waze.com/ul?ll=",latitude,"%2C",longitude,"&navigate=yes&zoom=17";) AS navigate
Then you can just use the View As Hyperlink property on the calculated navigate field

S
shoppy author 8/8/2018



I think you're trying to do it the hard way.
Why not add the link as a calculated field, eg. add this to your SQL query at the end of the SELECT statement :-
concat("https://www.waze.com/ul?ll=",latitude,"%2C",longitude,"&navigate=yes&zoom=17";) AS navigate
Then you can just use the View As Hyperlink property on the calculated navigate field


What SELECT statement do you mean Kevin?

Can you maybe give me an example of the script I need please?

HJB 8/8/2018

https://xlinesoft.com/phprunner/docs/sql.htm
... view the first screenshot within above ...

S
shoppy author 8/8/2018

Great !!!
This exactly what I needed.
As Kevin said I made a 'link' of the navigate field and it works like a charm.
Thanks thanks thank guy's