-
Adding account team member on account object in Salesforce
trigger TeamMember on Account (after insert) {
if(trigger.isinsert){
for(account acct:trigger.new){
if(acct.ParentId!=null && acct.VPA__c==false){
Account Parentacct=[select id,ownerid from Account where id=:acct.ParentId limit 1];
system.debug(Parentacct +'parentaccount');
Accountteammember acctmem=new Accountteammember();
acctmem.AccountId=acct.id;
system.debug(acct.id +'id');
acctmem.UserId=Parentacct.OwnerId;
acctmem.TeamMemberRole='Account Manager';
system.debug(acctmem +'accounteam');
insert acctmem;
}
}
}
}DML requires SObject or SObject list type: AccountTeamMember on line 13
Log In to reply.
Popular Salesforce Blogs
Details About Separation of Concerns | Salesforce Developer Guide
At the point when You Don't Need SOC on Force.com One critical advantage of Force.com is its definitive improvement model that allows you to make…
Top 10 Features of Code Completion for Lightning in JetForcer IDE
Today, I would like to tell you about the top 10 code completion features in JetForcer IDE, which indeed save time during developing Lightning applications.…
Update: Our Salesforce WordPress Portal Has a Page Builder Feature Now!
We are pleased to announce that we have added a brand new feature to our Salesforce WordPress customer portal, drag and drop page builder with…
Popular Salesforce Videos
Salesforce Connections 2018 Keynote - Ch. 1: Corporate Positioning
Salesforce Connections 2018 Keynote – Ch. 1: Corporate Positioning Salesforce Connections 2018 Keynote – Ch. 2: Ticketmaster Is A Trailblazer Salesforce Connections 2018 Keynote –…
Dreamforce 2021 Main Keynote - Welcome to the Trusted Enterprise | Salesforce
Today, every business has to transform to become a Trusted Enterprise. Join Marc Benioff & special guests to learn how Customer 360 helps businesses of…
Level Up Your Processes With Google API and Salesforce Integration
Complex processes often span multiple systems. In this session, we'll cover how to integrate Google APIs into your Salesforce org with an API library in…