Avatar

Remove Vehicle serial no

0

Hi,

 I want to remove serial number from a vehicle and make vehicle archive. How can I do that? I didnt find any way that I can make serialno blank for a vehicle.

 

Kindly guide me.

Apoorva Pandya

Please sign in to leave a comment.

5 comments

0
Avatar


Hello Apoorva ,

If you wish to make a device archived or historical, then you will need to “unplug the device” in your MyGeotab database. To unplug a device, find the vehicle on the Vehicles page and select it. Once the correct vehicle is selected, select the “+ More details” button atop of the screen. After pressing more details additional options will now appear, one of those being “unplug device”. Select the button and a pop up window will show up asking if you to confirm the unplug. We want to unplug the device so press Unplug Device once again to finalize the changes. The vehicle is now historical. 

If you have any other questions are concerns, please feel free to let us know.

Daniel Donelson 0 votes
0
Avatar

Thanks Daniel for your response but I want to do it from javascript api. Can you pls help me with that?

Apoorva Pandya 0 votes
0
Avatar

Hey Daniel,

 Can you please give me a sample code for javascript api to unplug a vehicle?

Thanks in advance.

Apoorva Pandya 0 votes
0
Avatar

Hi Apoorva,

Unplugging a device via the API is accomplished by setting the activeTo date to today.

In Javascript you would do something similar to:

api.call("Get",{"typeName":"Device",
"resultsLimit":10,
"search":{
"name":"DEVICENAME"
}},function(result){
var deviceObject = result[0];
if (deviceObject) {
deviceObject.activeTo = new Date().toISOString();
api.call("Set", {
"typeName": "Device",
"entity": deviceObject
});
}else {
console.log("There is no device with such name");
}
});

Mauricio Muniz 0 votes
0
Avatar
could you help me, I have not succeeded
 $device = $api->call("Get", [
"typeName" => "Device",
"search" => [
"serialNumber" => $gv->serie,
]
]);

//Comprueba si esta dado de alta
if (count($device)>0){
$toDate = new DateTime();
Flash::info($toDate->format('Y-m-d H:i:s'));
$device[0]['name']="Disponible-P1".$gv->locacion;
$device[0]['activeTo']=$toDate;
$api->call("Set", [
"typeName" => "Device",
"entity" => $device[0]

], function ($results) {
var_dump($results);
}, function ($error) {
var_dump($error);
return $error['jsonrpc'];
});
}else{
Flash::error("error");
}
Lsomohano 0 votes