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
Sourav PSourav P 

Cretaing a specific auto number field under certain criteria

Dear All,
I want to create a field "invoice number" which keep on increaing the value for each records but under certain criteria. Can you plz suggest how to realize it, Thanks,
I jst tried the formula field , But how to make the second parameter keep increaing to one for each new record created ?
 
IF( AND(Quote.ContractId !=Null,TEXT(Quote.Contract.Status)="Activated",Trans_Gross_premium__c!=0,Product2.Name="Voluntary"),"TI00500000",Null)

 
sfdcFanBoysfdcFanBoy
Lets say the auto number formula field is called Counter__c and the criteria to increment is these 2 conditions
  • Quote.ContractId!=Null
  • TEXT(Quote.Contract.Status)="Activated")
Then the formula field will be this

IF( AND(Quote.ContractId!=Null, TEXT(Quote.Contract.Status)="Activated") , Counter__c+1, Counter__c)

Thanks,
Manish
https://sfdcfanboy.com
Mark the solution as Answer, if its works for you