function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
CJDEVCONPROCJDEVCONPRO 

Add New Contact via VB.NET 2003

I have a VB.NET app that I want to be able to open the New Contact page in SF.

I am trying this:

Process.Start("https://na1.salesforce.com/secur/frontdoor.jsp?sid=" & loginRes.sessionId & "&retURL=/003/e%26con10%3d" & TextBox1.Text)

But it is not working. I get redirected to a page that says the URL is no longer valid.

Any ideaS?
DevAngelDevAngel
No. No ideas. Try it by stepping through your code and copy the generated url to the clipboard, and then paste into the address of the browser. Start removing stuff from the right of the resulting url until you get a good response.
CJDEVCONPROCJDEVCONPRO
I keep getting the error.

How should my link look to add a contact from VB.NET 2003?
LionelLionel

In the retURL part, add the prefix ..%2F, so instead of

Process.Start("https://na1.salesforce.com/secur/frontdoor.jsp?sid=" & loginRes.sessionId & "&retURL=/003/e%26con10%3d" & TextBox1.Text)

you now have this:

Process.Start("https://na1.salesforce.com/secur/frontdoor.jsp?sid=" & loginRes.sessionId & "&retURL=..%2F003%2Fe%26con10%3d" & TextBox1.Text)

 

(I also replaced the "/" character by the "%2F" encoded version...)

This is because when the redirection occurs, it keeps the "secur" virtual folder in the path, which screws up the redirection...