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
GrantSchenckGrantSchenck 

Creating New Contact

We are developing a Telephone interface modeled on the STAPI sample. In that regard, we want to handle the situation where a caller ID doesn't match any record by sending the user to the New Contact page with the phone number field populated. The user would then supply a last name and any other details and save (or not) the resulting new contact record.

What the the steps I need to do to actually do this programatically?

Thanks,

Grant Schenck
ShoreTel
DevAngelDevAngel
Depends on how much ui you want to build. You can pop a screen directly to the new contact page in salesforce in a similar way that you would contact details (in the case where the caller id exists and you found a unique match). The frontdoor.jsp url for this would look like:

https://na1.salesforce.com/secur/frontdoor.jsp?sid=<sessionid>&retUrl=/003/e
GrantSchenckGrantSchenck
I'm losing you on this:

https://na1.salesforce.com/secur/frontdoor.jsp?sid=&retUrl=/003/e

If I just type that in replacing the sessionid with my session ID should that take me to the contacts page? When I try it, I just go to the home page (https://na1.salesforce.com/home/home.jsp)...

I'm not clear what you mean about UI. I have a phone number I got from my phone system, I look it up and get no hits so I want to provide a popup to allow the user to go to the SF create a contact page with the number already plugged into the "Phone" field

In that regards, is there anyway to populate the "Phone" field of the new contact once I get it to take me to the new contact page work?

Thanks
DevAngelDevAngel
Well it might be retURL, but that should take you to a new contact page.

There are some unsupported ways to prepopulate parts of a new record. What you can do is add more to the retURL (escaping is really important from here on). For adding a phone number to the Phone number field you could make the return url retURL=/003/e&con10=6503666658.

con10 is a wacky field name for the Phone number input box and when the page loads it will try to find any query params that match form fields and preset the values.
GrantSchenckGrantSchenck
Thank you very much! That cleared things up.

Regards.
GrantSchenckGrantSchenck
Dave,

I spoke too fast.

If I just surf to a new contact form and then splice on the "&con10=12345" and hit enter that works. Specifically I'm on the new contact page with the phone number set to 12345. However, if from my code I form up the URL with the SID and tack on the same "&con10=12345" I just go to the new contact page but without the phone number filled in.

Any ideas?

Regards
DevAngelDevAngel
Make sure that you are escaping correctly.
GrantSchenckGrantSchenck
Sorry, I guess I'm asking more web questions the SF specfic...

Not sure what exactly you mean.

I form up my URL as so:

string retURL = m_strHomeURL + "&retURL=/003/e&con10=" + strPhoneNumber;

where the m_strHomeURL has my URL + SID

What would I need to alter to get it work?
DevAngelDevAngel


GrantSchenck wrote:
Sorry, I guess I'm asking more web questions the SF specfic...

Not sure what exactly you mean.

I form up my URL as so:

string retURL = m_strHomeURL + "&retURL=/003/e&con10=" + strPhoneNumber;

where the m_strHomeURL has my URL + SID

What would I need to alter to get it work?


Assuming that m_strHomeURL contains the frontdoor.jsp syntax (https://<host>/secur/frontdoor.jsp?sid=<sessionId>) then for the retURL you should use &retURL=/003/e%26con10%3d" + strPhoneNumber.

%26 = &

%3d = =

GrantSchenckGrantSchenck
Thanks Dave,

I'm not able to test this until next week but I'll let you (and others) know how things worked out.

Regards, Grant
GrantSchenckGrantSchenck
I just can't seem to get this...

Here is what URL I generate to try to go to the create contact page with the phone field filled in:

https://na1-api.salesforce.com/secur/frontdoor.jsp?sid=dXEQQjT0S7RCgBFER6fC6Bbw7XrOIolH1tYlh690SoBgD.dpoYNAOazbKKiyrZ22dzj8GxOu7ZSE9aErZC7PmmpYnKO9AsNCSeX5jsUoLXQ=&retURL=/003/e%26con10%3d152

Instead I go to:

"URL No Longer Exists" page. I see IE changes the URL to:

https://na1-api.salesforce.com/003/e&con10=152

So, what the heck am I doing wrong? I tried endless variants but can't see to get it to work.

Thanks, Grant
GrantSchenckGrantSchenck
Finally figured it out. Those bloody escape characters combined with confusing & with ? but all is resolved now. Thanks for you help. Regards, Grant
DevAngelDevAngel
Can you provide information on your product? Is it aimed at developers or end users?
GrantSchenckGrantSchenck
It is aimed at both. This is being developed for ShoreTel. ShoreTel is a medium sized Telephone (PBX) manufacturer. They support Microsoft's TAPI protocol at both a server and desktop level. The development is based roughly around the Salesforce STAPI sample. Specifically, using ShoreTel's native TAPI features via a custom COM object I'm providing a tray icon application which acts as a server. It watches for inbound offering calls and when they present, retrieves the caller ID. It then uses the SF web services interface to query for the any contacts, leads or accounts with matching phone number. If none of found then it pops up a toaster to request to create a new contact (hence my interest in this thread) or a new lead. Depending on what is clicked I launch a browser with the appropriate URL. If a single record is found then the user gets a toaster where they can select to navigate to the corresponding SF page or open the assocaited "Log a call". Finally if multiple SF records match the caller ID then we provide a toaster to search. That is how the inbound integration works.

For making calls, we provide an Internet Explorer toolbar which watches for SF page downloads and if the page has number fields (determined via our tray icon server querying SF via web services) then we list those on the tool bar and a user can select one of the numbers from a list box associated with the toolbar and call the party. They can also call in such a way that the browser will automatically open a "Log a Call" page.

Our intent is to provide both built binaries as well as the source so that users who wish to customize it in ways we haven't anticipated are free to do so. Because of the reliance on our own COM object this won't usable on non-ShoreTel systems.

Grant Schenck