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
Rst123Rst123 

Auto number : Apex class issue

if parent record is same then child record will have same number with different version, increment in number will be based on (set of policy records) realted to parent records , so policy records having same parent will have same number.

But having standard autonumber will create new number for each child record created??

my requirement is to write logic for below condition :
==================
Parent : opportunity 1
Child records :  
Pol - 1000 - v0
 Pol - 1000 - v1     (if you observe the numbring 1000 is common for both child under opportunity 1)
===================
Parent : opportunity 2
Child records :  
Pol - 1001 - v0
 Pol - 1001 - v1     (if you observe the numbring 1001 is common for both child under opportunity 2)
==================
Parent : opportunity 3
Child records :  
Pol - 1002 - v0
 Pol - 1002 - v1     (if you observe the numbring 1002 is common for both child under opportunity 3)