You need to sign in to do that
Don't have an account?
How to generate user defined AutoNumber in Apex class
Hi,
I have requirement, where in I have 2 record types, Hardware Record Type and Software Record Type under Opporutnities, I just want to generate two separate autonumbers for Hardware recordtype and Software recordtype. I tried to get this using functionality, but I am not getting the desired output.
Output
HW-0001
HW-0002
HW-0003
SW-0004
SW-0005
SW-0006
Desired Output
HW-0001
HW-0002
HW-0003
SW-0001
SW-0002
SW-0003
For the above requirement, I want to generate autonumber in an Apex Class, could any one please send the solution for the above mentioned requirement.
Regards
Arun
Adding a "if" condition may solve your problem.
eg:
if(RecordType== 'Hardware')
{
//increment HW
}
if(RecordType== 'Software')
{
//increment SW
}
If this does not work, Kindly post your code.
Thanks,
Shailesh. P. Deshpande