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
MiguelGuerreiroMiguelGuerreiro 

CMSForce and web form

Hello,

 

I'm using CMSForce to create a web form for a custom object (which has a look up field for Contacts). Is there a way to automatically link the custom object to the correct contact when he saves the record in the web form? Maybe using his email address?

 

Thanks!

Best Answer chosen by Admin (Salesforce Developers) 
David VPDavid VP

Hi Miguel,

 

There's 2 possible solutions to this problem :

 

1) Write a trigger on your custom object that will link it up with the correct contact

2) If you invite people to fill in the form via email, you can already insert the contact id via merge fields in the mailtemplate & web form url that you point them to, dynamically linking up the custom object to the person that clicked on the link. See page 22 of this guide.You can keep the contact field hidden, the 'prefilling' via url will still work.

 

Hope this helps,

 

David

All Answers

David VPDavid VP

Hi Miguel,

 

There's 2 possible solutions to this problem :

 

1) Write a trigger on your custom object that will link it up with the correct contact

2) If you invite people to fill in the form via email, you can already insert the contact id via merge fields in the mailtemplate & web form url that you point them to, dynamically linking up the custom object to the person that clicked on the link. See page 22 of this guide.You can keep the contact field hidden, the 'prefilling' via url will still work.

 

Hope this helps,

 

David

This was selected as the best answer
MiguelGuerreiroMiguelGuerreiro

solution 2 worked fine fine!