You need to sign in to do that
Don't have an account?
Markey1
Sites - How to Set Record Type via Link
For my Site, I want the user to be able to click, for example, the Enrollment link which will take the user to the Enrollment Page... but, I also want to set the record type based off which link is clicked as well. How do I accomplish this?
<apex:component > <div id = "menu_container"> <div id = "menu"> <ul> <li class="menu_header">Some Name <ul> <li><a href="http://testing.somename.cs3.force.com/enroll">Enrollment</a></li> <li><a href="http://testing.somename.cs3.force.com/cert">Certification</a></li> </ul> </li> </ul> </div> </div> </apex:component>
We need to send RecordTypeId by using QueryString parameter,
your NEW url will be like this
Replace SFID with your actual recordType Id ,
access this parameter on your VF page
set like using Custom_Object__c.RecordTypeId=SFID
this will set your RecordType for inserted record
Thanks,
Bala
Hi Bala Wani,
Thanks for your reply. My link code is now:
The url is updating correctly
However, when the record saves the Record Type is not updating correctly. How do I
"access this parameter on your VF page, set like using Custom_Object__c.RecordTypeId=SFID... this will set your RecordType for inserted record"?
If required I can display this on the Visualforce Page but I'm trying to get it to save without the end user ever seeing the Record Type field. Do you need me to post my VF page code as well?
Or, should my link code be something more like:
If so, how do I pass the parameter to the VF page so it saves the Record Type on save?
Bala Wani,
I'm still stuck... I feel like I am close and any assistance is much appreciated.
My Link:
My VF:
Class Snippet: