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
Lakshmi Mohan 15Lakshmi Mohan 15 

Can we override default record type for the profile iin Apex trigger ?

Hi ,

I am new to salesforce  I am creating custom VF pages for communities .
My question here is
Thre is a profile that the users are logging in Communities with Custom Partner Profile which has 'End' as the default record type as it is the only record type.
So the community users logs in creates lead with (End record type) convert into Opportunity(End record type) .. after an opportunity of End record type is created ,  i have created a  trigger which would create Lead with(seller record type) .. but unfortunately it is creating Lead with End Record type ..

Any suggestions or help for get lead of record type as seller ?? Is there any possibility
Many thanks






 
riyaviriyavi
Please post the sample code of the trigger. Does the trigger hit a Without Sharing class to create the lead?