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
lucky25lucky25 

how to write trigger in account object

how to write trigger in account object if you choose  industry type account number will increase

jungleeejungleee

Hi ,

 

What is your exact requirement??

 

Anyways, You can write trigger in account by going to SetUp->youName->App Setup->Customize->Accounts->Triggers->click on New Button. You should be able to write you Account trigger here.

 

Regards

Sam

maja madi

lucky25lucky25
for example in new account if you choose industry type=education account number=1 next you choose industry type=eduction ,account number=2, how to in crease using trigger
jd123jd123

I think your requirement is while creating Account if you choose Industry type the Account no should increase am I right?

 

For this 

 

trigger AccNoInccrease on Account(after insert)
{
List<Account> acc=trigger.new;
if(acc[0].Industry!=null || acc[0].Industry=='')
{
  acc.Account_No__c(right your field Name)++;(give default value is 0 or 1
update acc;
}
}

 

 

If it resolved your question please mark it is resolved if not please let me know