Hi every one
bellow code written in Java scripts
function getLocation()
{
debugger;
var isCrmForMobile = (Xrm.Page.context.client.getClient() == "Mobile")
if (isCrmForMobile)
{
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
var today = new Date();
today.setDate(today.getDate());
Xrm.Page.getAttribute("actualstart").setValue(today);
}
}
else
{
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
var today = new Date();
today.setDate(today.getDate());
Xrm.Page.getAttribute("actualstart").setValue(today);
}
}
}
//Set Latitude and Longitude field based on GPS co-ordinates.
function showPosition(position)
{
debugger;
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
Xrm.Page.getAttribute("pcl_latitude").setValue(latitude.toString());
Xrm.Page.getAttribute("pcl_longitude").setValue(longitude.toString());
var today = new Date();
today.setDate(today.getDate());
Xrm.Page.getAttribute("actualstart").setValue(today);
geoTaggingRefresh();
}
we have appointment entity, In that we have Start appointment Button in this entity.
Start appointment Button from ribbon workbench function ==> getlocation(start appointment button commond function)
when we click on start appointment button ....it store the value for latitude and longitude field value.
but what is happening sometimes that ... latitude and longitude field value is not taking , may be because of if users not clicking on start appointment button orrrrrr may be its not taking value for latitude and longitude because of location tracing problem.
so we are not able to get their location of appointment..
please some suggest me urgent what best can be done for this ..