Hyperlink with space in COMPANYNAME not working

deV.ch
Member Posts: 543
I have a problem in NAV2009 R2 with a hyperlink and a companyname that has spaces in the URL
When i run the hyperlink from the shell without spaces i get an error (of course).
When i run the hyperlink from the shell with %20 it works.
So i added url encoding to the companyname in NAV and pass that to the HYPERLNIK() function.
The strange thing is that the string that is sent to the shell is with spaces and not with %20! I know that because i changed the application which reacts to protocol DynamicsNAV: to a self made c# application and this gets the url with spaces as argument.
It seems like the HYPERLINK() function changes my %20 to spaces (what imo makes no sense...) before sending it to the shell.
this is the code i use to generate the link:
Any ideas?
When i run the hyperlink from the shell without spaces i get an error (of course).
When i run the hyperlink from the shell with %20 it works.
So i added url encoding to the companyname in NAV and pass that to the HYPERLNIK() function.
The strange thing is that the string that is sent to the shell is with spaces and not with %20! I know that because i changed the application which reacts to protocol DynamicsNAV: to a self made c# application and this gets the url with spaces as argument.
It seems like the HYPERLINK() function changes my %20 to spaces (what imo makes no sense...) before sending it to the shell.
this is the code i use to generate the link:
GetServerAndServiceName(ServerPortTxt,ServiceTxt); CASE _ObjectType OF _ObjectType::Page : RunObjectTxt := STRSUBSTNO('runpage?page=%1',_ObjectNo); _ObjectType::Report : RunObjectTxt := STRSUBSTNO('runreport?report=%1',_ObjectNo); END; HyperlinkTxt += STRSUBSTNO('DynamicsNAV://%1/%2/%3/%4',ServerPortTxt,ServiceTxt,URLEncode.URLEncode(COMPANYNAME),RunObjectTxt); IF _Mode <> _Mode::" " THEN HyperlinkTxt += STRSUBSTNO('&mode=%1',_Mode); MESSAGE(HyperlinkTxt); // <= this shows the correct URL with &20 EXIT(HyperlinkTxt);
Any ideas?
0
Comments
-
I suggest to use windows host script instead.0
-
-
Using the '+' sign causes an error that this company doesn't exist...
@ara3n
Of course this would be a solution, in fact i currently try to use interop to start the hyperlink, but imo this is not a good solution, because the built in function Hyperlink should be capable of doing this and no workaround should be needed for such a simple function...
edit:
for now i did it with your solution ara3n, because dotnet requires SPN or the client settings changed to "ServicePrincipalNameRequired" = false , and i don't want to do one of this for such a simple requirement...
a shame that dotnet interop on client side needs SPN or ServicePrincipalNameRequired=false to NOT ask for permission EVERY time!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions