+ Start a Discussion
Govardhan Reddy GuduruGovardhan Reddy Guduru 

Autonumber for a field based on record type record creation on case object.

Tried wit Formual but No luck, trying to implement a trigger.
Raj VakatiRaj Vakati
That is the only way ... If you want generally auto number it count for all record types 

Autonumber for a field based on record type is only way is you can able to do it based on the apex trigger ( before insert )

like below 
trigger AutonumberRecTypeCustomer on Account (before insert, before update) {

    list<Account> Acc= [SELECT Id,Name,Customer_Number__c FROM Account WHERE Customer_Number__c !=:null order by Customer_Number__c desc limit 1];
    decimal maxlead = Acc[0].Customer_Number__c;    

    for(Account Acci:Trigger.new){
        if(Acci.RecordTypeId =='012a3456789BCde'){
            Acci.Customer_Number__c = Integer.valueOf(maxlead)+1;