Route 'xxxview.php' not found

v2021: how do you trouble shoot this:

404
Error
Route ‘clientsview.php’ not found.

debug enabled, no log file entries

there is an entry in routes:
$app->any(‘/clientsview[/{id}]’, ClientsController::class . ‘:view’)->add(PermissionMiddleware::class)->setName(‘clientsview-clients-view’); // view

resolved:

had to change some custom code that displayed the master record and its details on the view pages.

FROM
this->ViewUrl = “clients_employeesview.php?showdetail=”…

TO
$this->ViewUrl = “clientsemployeesview?showdetail=”…

i’m assuming to the route name instead of the php files…

See Migrating to v2020: https://phpmaker.dev/doc/migrate2021.htm

In general, simply remove “.php” and the parameter names for the primary key fields, and separate them by “/”, e.g. change carsview.php?ID=1&foo=bar to carsview/1?foo=bar.

thanks guys, appreciate the info.

Hi. I have the same problem.

I want a custom php file to display records using the id when clicked.What will I do? I tried changing the path (remove .php and change to /) in custom file property and prefix in hyperlink property in the table but still error 404 Route not found.Thank you for the help.

You may:

  1. Post your code in the Custom File and the Custom File settings for discussions,
  2. Search “Custom File” in the forum for more discussions.

Thank you

<?php
// Show System Message
Currentpage()->ShowMessage();
// Initialize Database Helper
$db =& DbHelper();
// Validate ID Value & Attributes
if (isset ( $_GET ["application_id"] ) && ! empty ( $_GET ["application_id"] ) && ctype_digit ( $_GET ["application_id"] )){
	// Initialize Variable
	$ltoNumber = $_GET ["application_id"];
	// Query LTO Details
	$ltoDetails = ew_ExecuteRow("SELECT * licensed_est WHERE application_id = " . $ltoNumber . " LIMIT 1");
	// Check if Valid Application Number
	if (empty($ltoDetails["ltoNumber"])){
		// Redirect to Log Out Page
		header("Location: logout.php");
	}	
} else {
	// Redirect to Log Out Page
	header("Location: logout.php");
}
?>

Change ew_ExecuteRow to ExecuteRowAlso, this code:
header(“Location: logout.php”);should be:
header(“Location: logout”);

General:
Name                                    establishment_record.php
Generate                               checked
Caption                                 Establishment Record
Output Folder          
Include common files         checked
Default

mobhar wrote:

Change ew_ExecuteRow to ExecuteRow> Also, this code:
header(“Location: logout.php”);> should be:
header(“Location: logout”);

Done this but still 404 error

Note that v2021 uses routing (read Migrating to v2021), in your case make sure you use Include common files for your Custom File. When you access the page, you use URL like //mysite/myapp/mycustomfile (no .php, not mycustomfile.php).Make sure also you have set up URL Rewrite properly, see the last post of https://discourse.hkvstore.com/t/migrating-to-v2022/655/1