Does anyone know if there is a way to check if a URL to a webpage is valid (i.e. check for a 404 error) from within Nav. I'm playing around with record links and want to create a batch job that checks if the links are still valid.
2) If you are using NAV 2009 R2 then you should be able to call .NET assemblies and managed C# or VB.Net code. There are a few posts of how to do this in C# and see the links below. This should be pretty easy to code & deploy.
Answers
1) Use the IWebBrowserApp COM control (or some other control like it) to retrieve the site and check the returned content for 404 error code.
See: http://www.codeguru.com/Csharp/Csharp/cs_webservices/article.php/c5481
2) If you are using NAV 2009 R2 then you should be able to call .NET assemblies and managed C# or VB.Net code. There are a few posts of how to do this in C# and see the links below. This should be pretty easy to code & deploy.
Example 1: http://stackoverflow.com/questions/924679/c-how-can-i-check-if-a-url-exists-is-valid
Example 2: http://stackoverflow.com/questions/3826370/how-to-validate-a-url-in-c-error-404
Epimatic Corp.
http://www.epimatic.com
In case anyone else ever wants to do this:
Where XMLHTTP = 'Microsoft XML, v6.0'.XMLHTTP60