+ Start a Discussion
kiran punurukiran punuru 

how to restrict users from deleting the opportunity team members

Hi ,
How to restrict users from deleting opportunity team members which means only system admin can only delete the opportunity team members .can someone suggest on this?

thanks
kiran
Rakesh51Rakesh51
You can write a trigger on OpportunityTeamMember object to restrict users to from deletion.

trigger LicenseTrackingUserTrigger on OpportunityTeamMember (before delete) {

       if ( trigger.isDelete ) {
        for ( License_Tracking_User__c ltu : Trigger.old ) {
                ltu.addError('Action Not Allowed!');

        }  
    }
}
 
kiran punurukiran punuru
HI Rakesh,

I did not understand why you are using license_tracking_user__c in for loop.can you tell in detail please.

thanks
kiran