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
MarinaMartinMarinaMartin 

Accessing Records Only by ID in URL?

Hello,

 

I have a client asking to do something that I don't believe is possible. Can anyone confirm?

 

They want to be able to send a link to a website form to a client. The URL will contain only the Contact ID. Based only on that Contact ID, they want to pre-populate form fields such as name and email address from Salesforce.

 

I will happily be proven wrong. Thanks for reading!

 

Marina

Best Answer chosen by Admin (Salesforce Developers) 
Andy BoettcherAndy Boettcher

You COULD do this...

 

If I understand right - you're looking to make a NEW contact?

 

If you create a new Custom Object - and define it to have all of the "Contact" fields you want to have pre-populated....and then your URL could contain the Id of that new Custom Object.

 

The user would click on the link, go to a Sites page (or if they're a SF User, a VF page) that would pull up that record, pull the field values - and then pop up a new Contact form with those values in the proper fields.

 

Doable.

 

-Andy

All Answers

ngabraningabrani

Hi Marina,

I am not sure I have understood the question properly. The following is definitely possible. You redirect to a URL like --

 

https://na10.salesforce.com/a01F0000008YmiM

 

here a01F0000008YmiM is a record id. In the Visualforce page, we can define an action method. The action method can initialize any necessary fields as per the requirements, before the page gets loaded.

MarinaMartinMarinaMartin

Hi there,

 

Yes, I understand that is possible if you are logged into Salesforce. What my client wants is a URL such as:

 

http://theirwebsite.com/their_form_here.php?ContactId=234787654567898

 

They expect, based solely on this URL, that the fields on the form on their personal website (not Salesforce) will be able to be pre-populated with information via the ContactId.

 

Thanks

Marina

ngabraningabrani

Hello Marina,

Are you using Salesforce Sites for their website, if so then approach mentioned above may work.

 

If not, then it may require an integration. If the existing website is in J2EE/.Net, we can make a call to a Salesforce web service. Pass the contact id in the web service. The salesforce webservice could read the contact id, and return the required fields of contact.

 

Naveen

Andy BoettcherAndy Boettcher

You COULD do this...

 

If I understand right - you're looking to make a NEW contact?

 

If you create a new Custom Object - and define it to have all of the "Contact" fields you want to have pre-populated....and then your URL could contain the Id of that new Custom Object.

 

The user would click on the link, go to a Sites page (or if they're a SF User, a VF page) that would pull up that record, pull the field values - and then pop up a new Contact form with those values in the proper fields.

 

Doable.

 

-Andy

This was selected as the best answer